how to insert date and time to timestamp in Access

X

xfile

Hi:

Appreciate if anyone can enlighten me for the possible errors on the
following statement.

I wish to insert or update Assess timestamp field with ASP form sent by
users after they made changes.

-------------------------------------
In form A, define todaysDate, and send it to form B with a hidden field as
todaysDay
dim todaysDate
todaysDate=now()


in from B

todaysDate = Request("todaysDate")
mySQL = "UPDATE tb1A"
mySQL = mySQL + " SET UID= '" & Request("UserName") & "', PWD= '" &
Request("Password") & "',Timestamp= '" & Request("todaysDate") & "'"

----------------------------------------
I got error message for syntax error. Strange thing is... the above is the
first part of form B and before it, there is a checking statement to verify
if the user has changed it user name. This part is for user who has not
changed it.....

There is a second part similar to the above for user who has changed it.
The SQL statement is almost identical.

If I put Timestamp= '" & Request("todaysDate") & "' on the second part to
the last, there will be no error?

I have no idea at all.

Thanks in advance.
 
X

xfile

Correction, it won't show error on preview with IE, but it does for actual
running on the page :(
 
X

xfile

FYI.

Dim Today
Today = date

mySQL = "UPDATE TableName"
mySQL = mySQL + " SET Date_LastUpdated= '" & (Today) & "' "
Additional conditions if necessary to ensure records to be updated is the
right one.
 

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