Jump to content

Date = '01/01/0001'


bhardin

Recommended Posts

How do you typecast a date to a string?I am trying to search an AS400 database through the ODBC connection for a date of 01/01/0001.If I use this SQL statement it translates the date to 01/01/2001

SELECT * FROM BLPSO WHERE BLPSO.SORTDT = #01/01/0001#

If I try to use the following SQL Statement it throws a type mismatch error

SELECT * FROM BLPSO WHERE BLPSO.SORTDT = '01/01/0001'

Any ideas??

Link to comment
Share on other sites

ASPNetGuy:That still didn't work. I don't really understand what is happening here but...If I Open Excel and use the SQL Editor I can use this StatementSELECT * FROM BLPSO WHERE BLPSO.SORTDT = '01/01/0001'if I use the wizard then it returns stuff that has a date 01/01/2001If I use DAO in VB6 it also returns stuff that has a date 01/01/2001JustSomeGuy:I couldn't find what I was looking for in that search or any other searchthat I did. I even tried using stuff like "date returned as 01/01/2001 instead of 01/01/0001"Not sure if I'm just missing what I need to see or what.Still don't have it working.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...