Date in Field Returns Y for Yes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a query in which there is a date field. I need to write a SQL
statement that says if there is a date, then populate the field with a "Y"
for Yes, otherwise "N" for no. Not sure how to do this. Can anyone help?
Thanks in advance.

Janet
 
Type something like this into the Field row of your query:
HasADate: IIf([Date1] Is Null, "N", "Y")

Replace "Date1" with the name of your date field.
 
Janet,

Try something like:

SELECT Iif(IsNull([YourDateField], "N", "Y") from [YourTable];

Good Luck!
 
Thanks! That worked.

Janet

Allen Browne said:
Type something like this into the Field row of your query:
HasADate: IIf([Date1] Is Null, "N", "Y")

Replace "Date1" with the name of your date field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

JanetF said:
Hello,

I have a query in which there is a date field. I need to write a SQL
statement that says if there is a date, then populate the field with a "Y"
for Yes, otherwise "N" for no. Not sure how to do this. Can anyone help?
Thanks in advance.

Janet
 
Back
Top