Update Date/Time Field

G

Guest

I am trying to run an update query where if the Date/Time field is blank, I
want it to enter today's date. Here's what I have:
UPDATE Royalties SET Royalties.DatePaid = Now()
WHERE (((Royalties.DatePaid)="IsNull"));

I'm getting a data type mismatch, so I'm assuming that it has something to
do with the "DatePaid" field being a date/time field. I'm self-taught in
Access so I'm not too knowledgeable about what I could be missing to make
this work. Could someone help me?

Thank you so much!!
 
J

Jeff Boyce

WHERE IsNull([Royalties].[DatePaid]) = True

You tried to compare a date/time field with the literal string "IsNull"...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Great, Got it!! Thanks for your help!

Jeff Boyce said:
WHERE IsNull([Royalties].[DatePaid]) = True

You tried to compare a date/time field with the literal string "IsNull"...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Esaw said:
I am trying to run an update query where if the Date/Time field is blank, I
want it to enter today's date. Here's what I have:
UPDATE Royalties SET Royalties.DatePaid = Now()
WHERE (((Royalties.DatePaid)="IsNull"));

I'm getting a data type mismatch, so I'm assuming that it has something to
do with the "DatePaid" field being a date/time field. I'm self-taught in
Access so I'm not too knowledgeable about what I could be missing to make
this work. Could someone help me?

Thank you so much!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top