PDA

View Full Version : Write history to include sent date



cd52
09-13-2007, 04:47 AM
I can't seem to get the correct format for writing the sent date back to my access table. The other fields are working fine, but when I try to report back using %Today% I get an error if I don't enclose it in single quotation marks but I get the literal value %Today% if I do.
I changed the SentDate field in the access table to a text field because I got an invalid data type error when it was a date field.
My current syntax is simply:

SentDate=%Today%

It would really help to see an example.

SYSOPS
09-13-2007, 06:27 AM
If this is with SR ADO, are you doing something along the lines of:
update Orders set Date = %Today(mmddyy)% where OrderID = %RecordID%

You need to make sure that you're using the formatting code with the mergecode.
http://www.zfirm.com/Product_Documentation/ShipRush_v5-0_USPS/ShipRush_ADO__Fields_Reference.htm

HTH,
SYSOPS

cd52
09-13-2007, 09:35 AM
If this is with SR ADO, are you doing something along the lines of:
update Orders set Date = %Today(mmddyy)% where OrderID = %RecordID%

You need to make sure that you're using the formatting code with the mergecode.
http://www.zfirm.com/Product_Documentation/ShipRush_v5-0_USPS/ShipRush_ADO__Fields_Reference.htm

HTH,
SYSOPS
if the destination field is formatted as a date
Date=%Today(mmddyy)% results in a "Syntax in query expression" error.
Date='%Today(mmddyy)%' also results in a syntax error

if the destination field if formatted as text
Date=%Today(mmddyy)% results in a "Syntax in query expression" error.
Date='%Today(mmddyy)%' puts "%Today(mmddyy)% in the field iinstead of the date.

SYSOPA
09-13-2007, 10:27 AM
%TODAY% Merge macro supported in the SELECT operations only.

It is not supported for UPDATE. You would need to use capabilities of your database engine for updating date field. For SQL Server you would use GETDATE() function

cd52
09-13-2007, 12:30 PM
%TODAY% Merge macro supported in the SELECT operations only.

It is not supported for UPDATE. You would need to use capabilities of your database engine for updating date field. For SQL Server you would use GETDATE() function
Ah... that explains it... thanks...