Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Add command date error Post Reply Post New Topic
Author Message
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet 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.


please advise

Nammu

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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}).

I hope this helps.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.016 seconds.