Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help With Correct Date Format vs Sybase Database

Status
Not open for further replies.

TornCUFF

MIS
Jun 5, 2001
3
US
Wow! What a wealth of information here!

Can someone please help me?

I got a question from a SYBASE user trying to use a date in the Crystal SQL Designer...They keep getting an error message on the following line...

They want to compare to the date 6/01/2001

They've tried a bunch of statements similar to

and (d.END_DT >= ('2001-06-01') or d.END_DT = '00:00:00')


statement but crystal SQL designer returns an error " invalid date escape".

Not being a SYBASE/SQL guru, I don't know what the correct date format is here. Is there a way to eliminate the time?

Thanks for your help,

TornCUFF
 
Hiya,

The date format in Sybase is mm/dd/yyyy, so yesterdays date (I won't give today, June 6th not a good example!) was 06/05/2001.

Hence, your statement would be

and (d.END_DT >= ('06/01/2001') or d.END_DT = IS NULL)

Sybase will not accept 00/00/00 as a valid date, it will assign different values depending on how the table is designed, but if the column will accept nulls, the syntax to check for a null is as above.

HTH

Tim
 
Tim,

Thank you very much for your help...

I really appreciate it.

Thanks again,

TornCUFF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top