LillyC
asked on
How to replace a blank field with a zero in a query in Access 2010
I have a query that returns a value if an invoice is overdue, and it shows a blank if not.
I would like to replace the blank field with a zero, can anyone help?
I would like to replace the blank field with a zero, can anyone help?
ASKER
This doesn't seem to work Scott, my field is called InvoiceDate and if its 'blank' I want to force a '0'?
post the sql statement of your query
my field is called InvoiceDate and if its 'blank' I want to force a '0'
You cannot mix dates with a string. So what are you actually doing?
/gustav
The "0" date is Dec 30, 1899. Remember dates are not stored as strings. Dates are stored as double precision numbers with the integer porting being the number of days since the "0" date and the decimal as the fraction of time since midnight.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you :)
There is no need to check for a "valid date" as a date field only can hold either a valid date or - if the field allows - Null.
So just check for Null if that is your case - what you actually are trying to do is still a secret.
/gustav
So just check for Null if that is your case - what you actually are trying to do is still a secret.
/gustav
Right, if it is a Date field.
SELECT Nz(YourFieldName, "0") AS SomeField FROM SomeTable