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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return value for NULL fields when using date_format

Status
Not open for further replies.

connectionscentres

Programmer
Jan 5, 2005
16
GB
Hi,

I cant find the answer on the manual pages. Maybe I should look harder.

Basically I'm putting dates into a table using:
Code:
INSERT INTO TEMP date_format(INVOICEDATE, '%Y-%m-%d %H:%i:%s') As datei

then I can select dates that have put an INVOICEDATE in by doing:
Code:
SELECT * FROM TEMP WHERE datei>'1'

Only the reverse doesnt work, meaning I cant do a query for rows where no invoice date was entered (i.e. null)

So I need to know exactly what value the date_format function returns when it comes accross a null value. I've tried echoing the result to the screen and it returns an empty string but then doing a
Code:
SELECT * FROM TEMP WHERE datei NOT LIKE ''
doesnt work. Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top