Hi Vicky,

It took me awhile to figure this out.

All databases have their own formats for how to store date information -
this is something you shouldn't try to change. The problems arise when we
try and insert new date values through Witango into the database in a format
it doesn't expect.

If you are using the Witango Update or Insert Action, simply apply your date
value without the FORMAT="datetime:..." attribute:

<@CURRENTDATE> or <@ARG myDate>

As long as the value is a valid date. The Update and Insert Actions will
automatically convert your date value to the format required for your
database. If you look at your debugging information - your date might look
something like this on SQL-Server {ts '2002-06-14 00:00:00'} as opposed to
the 06/14/2002 value you passed in an argument or Metatag.

When you try to apply your date value with your own formatting during the
Insert or Update, example:

<@ARG myDate FORMAT="datetime:%d-%b-%Y">

Then Witango may fail to interpret your value properly because the format
might be conflicting with your server default format as specified in your
t4server.ini file (DATEFORMAT=%m/%d/%Y) which can then result in not
converting the value properly for your database.

What is your default value in your t4server.ini?

If what you want is the date displayed in your HTML in the 14-Jun-2002
format, then use the FORMAT="datetime..." attribute on the Search Action
output, like so:

<@COLUMN "table.myDatefield" FORMAT="datetime:%d-%b-%Y">

Or

<@VAR local$resultSet[1,myDatefield] FORMAT="datetime:%d-%b-%Y">

To summarize, don't mess around with the format on the Insert to the
database - just on the output.

Hope this helps. Cheers...


Scott Cadillac
http://xml-extra.net
[EMAIL PROTECTED]

VP, Research and Development
Plus International Corp.
604-460-1843
[EMAIL PROTECTED]
http://www.plusinternational.com

Vancouver, BC, Canada

Does your company have an Enterprise Information Portal? Check out Salsa at
www.plusinternational.com/flash/salsa.htm

----- Original Message -----
From: "Vicky Bagwalla" <[EMAIL PROTECTED]>
To: "Multiple recipients of list witango-talk" <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 12:25 PM
Subject: RE: Witango-Talk: Date Issue


> Through Tango, I am passing the date as %d-%b-%Y (Evaluates to
> 14-Jun-2002) into a column "datetime" in the database. Now the SQL user
> for this database (DSN on dev and deployment is set to BRITISH ENGLISH).
> All is ok and the value inserted in the database is 14/06/2002.
>
> PROBLEM: If the "day" part of the date is < 12 then the database flips
> month and day around . Example : 10-Jun-2002  . SHOULD be stored as :
> 10/06/2002   but is stored as 06/10/2002.
>
> Really really need help with this silly thing.
>
> Note: I can then go into SQL directly and enter date as 10/06/2002 no
> problem. Only through Tango !!!
>
> You may contact me off the list too at : [EMAIL PROTECTED]
>
> Thanks !
>
> - Vicky
>

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to