I have date coming to one page as a string in the following format
"May 4 2005 12:00AM"
I need to query one of my tables using this date in combination of other nondate values. How can I convert this date into valid sql server datetime format before I query a database tables
Please help
Hi,
you can use Sql function CONVERT :
convert(datetime,MYPARAM,110)
|||That format will work -- depending on your locale. Therecommended date format for SQL Server is the ISO format: YYYYMMDDHH:MM:SS.MS
Note that :SS.MS can be left off, or the entire time portion can be left off and the time will default to 12:00 a.m.
Is that what you're looking for?
|||
Hi there, I have some problem here, please help.
I use Format funtion as the format is "dd-MMM-yy" and my input date is "18/09/2005". system return me 4 char month instead of 3 char. 18-Sept-05. Anyone has idea how to solve this?
The regional setting of the PC is ok. So what other setting have been left off? IM using Visual Studio .net 2003 and working on XP professional with SP1 pc. Thanks!
No comments:
Post a Comment