Welcome to the Toad for Data Analysts Community
Advanced Search - Help - Search Toad World
Welcome, Guest
Login Login / Register
Help
NEW? Get Plugged In

Forums » Join Discussions About... » Toad for Data Analysts

Thread: Automation generating bad results from Date data

This question is answered.


Permlink Replies: 2 - Pages: 1 - Last Post: Nov 6, 2009 4:27 PM by: Debbie Peabody
julian.chasin_625

Posts: 14
Registered: 8/17/09
Automation generating bad results from Date data
Posted: Sep 22, 2009 2:28 PM
 
  Click to reply to this thread Reply

In my automation script, I am setting variables, running a query on an Oracle db, then looping thru the query results to deliver output data to an email.  The char() data resolves OK, but when I use date data I get strange results.
For example,
to_char(CREATION_DATE,'MON-DD-YYYY') Date_Rels
produces a numeric value based on the sum: (-dd -yyyy).  Changing to 'DD-MON-YYYY' gives similar results. 
See attachment for example.

If I use just the database attribute CREATION_DATE without converting to char, I get an error:

Automation Logging:09/22/2009 2:08:31 PM: Variable "Date_Rels" set to "#CompleteOrders.Date_Rels#"

Automation Logging:09/22/2009 2:08:31 PM: Variable value = Syntax error


Is this a known bug?  Workaround?




Debbie Peabody

Posts: 286
Registered: 2/15/07
Re: Automation generating bad results from Date data
Posted: Sep 22, 2009 3:53 PM   in response to: julian.chasin_625
Answered
  Click to reply to this thread Reply

Okay, I checked into this. I have some good news and some bad news.

The bad news --> your right. String dates are getting garbled. I am using some VB script to evaluate expressions. And any character such as '/' or '-' corrupts the string.

The only work around I found to work is to not use any of these characters. You would have to use a date value like SEPTEMBER 22 2009

to_char(sysdate, 'MONTH DD YYYY') mydate


This of course needs to be fixed, so I have entered CR 67,164 to be corrected in the next minor release.

Thanks for brining to my attention.

Debbie



Debbie Peabody

Posts: 286
Registered: 2/15/07
Re: Automation generating bad results from Date data
Posted: Nov 6, 2009 4:27 PM   in response to: julian.chasin_625
 
  Click to reply to this thread Reply

Okay this date issue as well as other items detailed in Cr 67,164 are now fixed and will be in the next Beta.

Debbie




Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums