SQL help

Try <> IsDate instead of Is Null
 
Thought the attached might make it easier to see.
A cut down version of the Db.

Cheers
 

Attachments

Peter,

You are only assigning your SQL to a string; you are not executing anything:

Code:
strSQL = "UPDATE [Andrews HWST] SET [Andrews HWST].andrews_date_datalable = " & Now() & " WHERE ((([Andrews HWST].andrews_date_datalable) Is Null ));"
Debug.Print strSQL

MsgBox "File created and records date stamped"

Try this, adding the #s:

Code:
DoCmd.RunSQL "UPDATE [Andrews HWST] SET [Andrews HWST].andrews_date_datalable = #" & Now() & "# WHERE ((([Andrews HWST].andrews_date_datalable) Is Null ));"

MsgBox "File created and records date stamped"

hth,
Wayne
 
Oops ! cutout too much from the original Db.

Yep Wayne you got there the same time as me, added # into the string either side and it ran fine:

Thanks everyone for your help

Cheers
 

Users who are viewing this thread

Back
Top Bottom