Being an Australian I have had to deal with this as well. Anthony is entirely correct in this - I have tried many ways to get inserts in the format I wanted with all sorts of strange values. Formatting a variable works.
The only other way that I have had any success to achieve dd/mm/yyyy date formatting for inserts using Tango is to set the server configuration to the date format you want (I have always used the config.taf to do this) - obviously this is not possible if you don't own/control the Tango server but the easiest if you do. Then you don't have to assign any formatted variables whatsoever. Garth At 04:55 14/06/02 -0400, you wrote: >"urn:schemas-microsoft-com:office:office" xmlns:w = >"urn:schemas-microsoft-com:office:word" xmlns:st1 = >"urn:schemas-microsoft-com:office:smarttags"> >Tango was originally coded in North America. Historically, we've used >mm/dd/yy as out default date format. Other people have used other formats >over time. Some of use have become more enlightened over time and realized >that YYYY/mm/dd was easier to read, less ambigous and easier to file -- >Its even the ISO short date format. But we often go back to our roots. > >That said, Tango, by default, thinks that any dates are entered mm/dd/yy >or mm/dd/YYYY by default and you'll have to convice Tango that it's >otherwise like so: > ><@ASSIGN SCOPE=local NAME=DateToUse VALUE='<@FORMAT STR="<@ARG >DateFromTheForm>" INFORMAT="datetime:%d/%m/%y">' FORMAT="datetime:<@VAR >dateFormat>">'> > >Then use the Var "DateToUse" rather than the Arg in your >insert/update/deletes >----- Original Message ----- >From: <mailto:[EMAIL PROTECTED]>Vicky Bagwalla >To: <mailto:[EMAIL PROTECTED]>Multiple recipients of list witango-talk >Sent: Friday, June 14, 2002 16:30 >Subject: RE: Witango-Talk: Date Issue > >Here you go : >Note: Three dates > >PurchaseDate � Entered on Form (dd/mm/yyyy) >Received Date - Entered on Form (dd/mm/yyyy) >EntryDate - <@CURRENTDATE> > >Date entered as 10/06/2002 in the form (For Purchase and Received date) > >INSERT INTO dbo.tblR >(REntryID,UserEntryNum,RCode,ProductModel,FirstName,LastName,Address1,Address2,City,ProvID,PCode,ZipCode,PhoneArea,PhoneF3,PhoneL4,EmailAddress,SerialNumber,Store,MediaID,InflID1,InflID2,PurchaseDate,ReceiveDate,EntryDate,EnteredBy,OKtoprint,ProblemID1,ProblemID2,ProblemID3,Bill,Coupon,UPC,Comments,HPQuestion1,HPQuestion2,HPQuestion3,HPQuestion4,EnteredUsing,RAmount,EntryAlert,AlertReason) > >VALUES ('HO150075','VB-75','HO','845C','Jh',NULL,NULL,NULL,NULL,0,' >',?,NULL,NULL,NULL,'',NULL,'1',NULL,NULL,NULL,{ ts '2002-10-04 00:00:00' >},{ ts '2002-10-04 00:00:00' },{ ts '2002-06-14 00:00:00' >},'vickyb','N',0,0,0,NULL,NULL,0,NULL,'','','','',?,40.00,'','') > > >Date entered as 14/04/2002 in the form (For Purchase and Received date) > >INSERT INTO dbo.tblR >(REntryID,UserEntryNum,RCode,ProductModel,FirstName,LastName,Address1,Address2,City,ProvID,PCode,ZipCode,PhoneArea,PhoneF3,PhoneL4,EmailAddress,SerialNumber,Store,MediaID,InflID1,InflID2,PurchaseDate,ReceiveDate,EntryDate,EnteredBy,OKtoprint,ProblemID1,ProblemID2,ProblemID3,Bill,Coupon,UPC,Comments,HPQuestion1,HPQuestion2,HPQuestion3,HPQuestion4,EnteredUsing,RAmount,EntryAlert,AlertReason) > >VALUES ('HO150076','VB-76','HO','845C','Jh',NULL,NULL,NULL,NULL,0,' >',?,NULL,NULL,NULL,'',NULL,'1',NULL,NULL,NULL,{ ts '2002-04-14 00:00:00' >},{ ts '2002-04-14 00:00:00' },{ ts '2002-06-14 00:00:00' >},'vickyb','N',0,0,0,NULL,NULL,0,NULL,'','','','',?,40.00,'','') > >Thanks > >- Vicky > > > > >Vicky Bagwalla >AReA Communications. > >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]] On Behalf Of Steve Smith >Sent: June 14, 2002 3:50 PM >To: Multiple recipients of list witango-talk >Subject: RE: Witango-Talk: Date Issue > >Can you turn on debug for the taf and run it twice, once with a day less >than 12 and once with a day greater than 12. Cut and paste the SQL >expression from each into a message and post it to the list for all of us >to see. > >Thanks, >Steve Smith > >Skadt Information Solutions >Office: (519) 624-4388 >GTA: (416) 606-3885 >Fax: (519) 624-3353 >Cell: (416) 606-3885 >Email: [EMAIL PROTECTED] >Web: <http://www.skadt.com/>http://www.skadt.com > >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]]On Behalf Of Vicky Bagwalla >Sent: June 14, 2002 3:25 PM >To: Multiple recipients of list witango-talk >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 : ><mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] > >Thanks ! > >- Vicky ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
