Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do the first date of the year in command

Status
Not open for further replies.

kate8

Programmer
Feb 14, 2001
184
0
0
US
I have a report that needs to be ran by schedule. So I need to set the time range to the first date of the year to the current date in Command. Here is what I am doing, but does not work in command:
register_date between date(year(currentdate),1,1) and sysdate
date(year(currentdate),1,1) works fine in the formula, show 1/1/2017. But does not work in command, Even I replace currentdate with sysdate, still got the error:
Failed to retrieve data from database. Detail: ORA-00936. Missing expression
How can I set the report run with the first day of the year in Command? Is it possible? Thank you very much for any help!!!
 
Hi,
I figured it out.
In command, the query syntax should work for your database. Since my report runs against Oracle database, so I do the following and it works.

register_date between TRUNC(sysDate,'YEAR') and sysDate

Hope that will help anyone who has the same issue.
Thanks!
 
This didn't work for you originally because you can't use Crystal functions in a Command - you can only use the syntax that's specific for your database. Also, the syntax you posted only works with Oracle. If you're using a different type of database, you'll use different syntax.

For more information about using commands, go here:
-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top