Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Topic: Add command date error Posted: 08 Dec 2009 at 11:54am
Hi,
I am using crystal 10 and this is the query iam trying to write in add command line
select * from pview where trunc(trandate)= to_date('{date1}','mm/dd/yyyy')
I have defined date1 as datatype date.
This always returns missing paranthesis error
I run this query and
select * from view1 where trunc(trandate)= to_date('01/01/2009','mm/dd/yyyy')
fetches data with no hassle
1) is it something wrong with 'trandate' field Iam using, bcos I have same type of query on other date datatype fields while creating reports in same crystal version in the past.
2)Is it because of the view on which iam querying. i dont think so because I can run same query in sql developer and come up with results.
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 08 Dec 2009 at 1:00pm
You should not be putting single quotes around the {date1}. it the function to_date is expecting a string (we used to call them a literal), then the {date1} has to be converted to a string (i.e., totext({date1}).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum