Avatar of rowfei

asked on 

Date Parameter

What formula can I add to the date field, so end user can either select data via the calendar or the shortcut key such as T-1, M-1 etc???

Thanks in advance.
Crystal Reports

Avatar of undefined
Last Comment
Mike McCracken
Avatar of peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

I appreciate this might just be me, but I have no idea what Crystal feature you are referring to by..
"the shortcut key such as T-1, M-1 etc"
Avatar of Mike McCracken
Mike McCracken

There is no way to do that.  Crystal date prompts expect a date to be entered.  There are no shortcut keys to choose a date.

If you have CR2008 you can have optional prompts.  You could use a date for 1 and a string for another then evaluate appropriately.

I assume T-1 is yesterday and M-1 is last month

Avatar of rowfei


Yes, I do have CR2008. Do you have any sample for using the string?
Avatar of James0628

Do you just want to use those specific strings, "T-1" and "M-1"?  If so, what do they mean?

 Or do you want to allow something more general, like "T-X", where "X" could be different numbers?  If so, exactly what do you want to allow?

 Producing yesterday's date when a parameter is "T-1" is easy.  Actually checking the value after the "-" and producing a date based on that is more complicated.

Avatar of rowfei


I would like to have:

T-"num" = today's day - num of days user enter.
T+"Num" = today's day + num of days user enter.

M-"num" = Current Month - num of month user enter.
M+"Num" = Current Month + num of month user enter.

Y-"num" = Current year - num of year user enter.
Y+"Num" = Current year + num of year user enter.

Also user should able enter what ever day they want on the beginning date and ending date field. Or select the date from the default calendar.

As stated above, the only way to get the calendar is to use a DATE or DATETIME parameter.  It will only accept valid dates.

You can add a second parameter as a string and they can enter whatever they want.

I will try to get an example put together.

Avatar of rowfei


An example will be great. Thank you so much!!!
Avatar of Mike McCracken
Mike McCracken

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Crystal Reports
Crystal Reports

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo