Hi John,
    I use TO_CHAR in my SQL statements whenever I need to query/update/retrieve the tables. I pass the format in which I am sending the date to the query and TO_CHAR transforms it accordingly. (The query would only be done on the mm/dd/yy and not mm/dd/yy hh:... this isuseful if I need to query just on the day.). I am not sure if there is any corresponding fn in MSSQL. There is also a SYSDATE which returns the date in the format which you want.
    To format the date, I use the SimpleDateFormatter passing it the pattern in which i need the date to be converted. I am not sure whether you can pass a string to it so that it constructs a Date automatically.
I hope this would be of some help...
Raaj.
 
Have a merry Christmas.
 
 
----- Original Message -----
Sent: Thursday, December 23, 1999 11:12 AM
Subject: Date formatting for MSSQL

Would anyone be kind enough to point me in the right direction for a peice if code that will format dates, retrieved from an MSSQL database, into something readable. The problem here is that MSSQL only stores dates in (yy/mm/dd hh:mm:ss) format. I need to format that into mm/dd/yy and I search by this formatted date. I am in the midst of a project where I must use the MSSQL datetime type.
 
Anyone have any suggestions. 
 
John D. McDonald
CipherStream Systems
Phone: 925.373.8700
Fax:     413.793.6603
email: [EMAIL PROTECTED]
web: www.cipherstream.com
-------------------------------------------------------
Secure E-Business Is Our Business
-------------------------------------------------------

Reply via email to