INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to do the first date of the year in command

How to do the first date of the year in command

(OP)
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!!!

RE: How to do the first date of the year in command

(OP)
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!

RE: How to do the first date of the year in command

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: https://blogs.sap.com/2015/04/01/best-practices-wh...

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
www.decisionfirst.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close