×
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!
  • Students Click Here

*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.

Students Click Here

Jobs

need help with date parameter

need help with date parameter

need help with date parameter

(OP)
I need a parameter that displays a date range but only shows month and year. I need to be able to go back at least 2 years or run it for say a month. May 2017 to June 2018 or April 2018 to April 2018 are 2 examples. Crystal dates show the day in the parameter and we can’t allow the user to select the day but only a month and year. Any help is appreciated. Thanks.


I had this set up with the parm set to a number and allowing a range but it gives an error if you try to check for a range like May 2017 to March 2018
(({CLNDR_MNTH}) in {?month-range}) and
//(PRODYR} in {?year-range}) and

RE: need help with date parameter

The simplest approach would be to ask the user to select ANY date in the beginning month and ANY date in the ending month, letting them know that the report will always start on the first of the starting month and end on the last day of the ending month. Then you would just use a formula like this:

{table.date} >= date(year({?start}),month({?Start}),1) and
{table.date} < dateserial(year({?end}),month({?end})+1,1)

Note the dateserial in the second part of the formula.

If you really must have users choose the month and date, you can hardcore the start date into the values list of the start parameter and the month/year in the description list. Repeat for the end date parameter.

-LB

RE: need help with date parameter

(OP)
Thank you LB!

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! Already a Member? Login

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