Just making sure

Results 1 to 2 of 2

Thread: Just making sure

  1. #1
    Join Date
    Dec 1969

    Default Just making sure

    I am just making sure this would work. I am wanting to insert the date into a table when it is modified though a scrtipt. Is the command I use:<BR><BR>&#060;%objrs("LastUpdate")=time()<BR>o bjrs.update%&#062;

  2. #2
    Join Date
    Dec 1969

    Default *INSERT* you said??

    You are adding a new record?<BR><BR>Then you *can* do that, but it&#039;s more efficient to just give the LastUpdate field a default value of NOW() [if using Access, GetDate() if using SQL Server] and let the DB supply the value for you.<BR><BR>If you mean you want to change an *existing* record, then it would be better to use a SQL Update statement.<BR><BR>Such as:<BR><BR>&#060;%<BR>...<BR>SQL = "UPDATE tablename SET LastUpdate = Now() WHERE someKeyField = &#039;" & someKeyValue & "&#039; "<BR>yourConnection.Execute( SQL )<BR>...<BR>%&#062;<BR><BR>Oh...and TIME() gets *only* the current time of day; it does not include the date with the time. Use NOW() to get both in one function.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts