Click here to Skip to main content
15,881,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey...!!!

i am facing a unique issue i.e. when i run my application locally then every thing goes okay. but when i upload my app on server and access from url to do a booking then front end works fine and data stored in database but when i go to view my all booking then store procedure failed to get latest record...

Sp has a where clause on Date. when i remove it then exe okay with new record but with where clause its not working... :(

where as same app is uploaded on another server then it work awesome with same SP with date filter...

cant understand where is the problem...
Posted
Comments
Bernhard Hiller 10-May-12 3:31am    
Is that "Date" stored as a date value or as a varchar?
Dhanamanikandan 10-May-12 3:45am    
Please share ur SP with Data type..
thotanagu 10-May-12 4:20am    
If your code and db are in the same server then it is ok.
else you need to send the db server date to sp from your code.

Sounds like a region issue. How are you supplying the date? If it's parameterised you shoud be ok, but date formats vary around the world and will be interpreted on the computer according to the Regional settings specified.

If at any point you are passing it as a string, format it such 'yyyy-mm-dd hh:mm:ss'
 
Share this answer
 
I think you need to format your date to a unique format so if any server has set to different region or its date format is some different then you use then it will cause issue same like you face one.


so you can do like this...

if you use a system date to compare with your SP where cause then use like this..


first of all convert your where cause date to particulate format like "dd-mm-yyyy" OR "dd/mm/yyyy" or any thing else

and other side where you use comparison date (System date) you need also to convert it to the same format you use to convert your where cause date.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900