Link to home
Start Free TrialLog in
Avatar of Ross
RossFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Correct VBA / SQL statement please

super quick one. I don't know how to use the update statement in sql

This is the essence of what I want:


strSql = "UPDATE " & SettingsTable & "SET [LastOOSLAImportDate] = (#" & Format(Date, "yyyy-mm-dd") & "#)"

SettingsTable is a variable I've defined. LastOOSLAImportDate is a field in the SettingsTable. The table doesn't have a bunch or rows, it's a simple non-indexed table with a few settings on it I use to retrieve settings from.

I want to update the one row thats in there to set LastOOSLAImportDate to today.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ross

ASKER

strSql = "UPDATE [" & SettingsTable & "] SET [LastOOSLAImportDate] = (#" & Format(Date, "yyyy-mm-dd") & "#)"
                                            

Open in new window


That's the ticket - thanks very much. I just couldn't get the formatting right!