avoorheis
asked on
Insert and update date field in asp.net app using access
I want to add a time stamp by inserting the current date when a user inserts or updates a record. This seems to be more difficult then I had expected, probably because I'm new and using Access (maybe issues with date formating).
Would it be best to have a hidden text box that get the current date in the insert item and edit item templates, or, another way. After date is updated, it will be displayed in the item template.
thanks for looking and your suggestions
alan
Would it be best to have a hidden text box that get the current date in the insert item and edit item templates, or, another way. After date is updated, it will be displayed in the item template.
thanks for looking and your suggestions
alan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
this worked
Dated = Now()
Dated = Now()
ASKER
I bet this will work if I know how to format it in the updatecommand. It works ok if I just replace DateTime.Now().ToString() with 'xxx'.
UpdateCommand="UPDATE tblDisplayInventory SET SF = ?, Dated = DateTime.Now().ToString() WHERE (AccountNo = ?)">
like it is now, I get this error:
Invalid use of '.', '!', or '()'. in query expression 'DateTime.Now().ToString()
thanks