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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Month & Year Parameter 1

Status
Not open for further replies.

dstalls

Programmer
Sep 27, 2007
18
US
I created a date parameter (named Service Start Date) that corresponds with the date in an existing field({TCL_SRVC.BGN_DT}) .

In the formula editor of the select expert I have:
Month({?Service Start Date})= Month({TCL_SRVC.BGN_DT}) and
Year({?Service Start Date})= Year({TCL_SRVC.BGN_DT})

The date parameter then gives a report based on the month and year that the user enters (which is what I want).

However, in addition (as one might expect), the user is prompted to give a full date with "day" included, though the same report will run regardless of the day (for example, whether the user enters 2007/12/01 or 2007/12/21).

How do I remove the "day" option?

I thought about making the parameter numeric, but this then would ignore the year (which is essential).

Thanks for your time and let me know if I am too vague (as I have a tendency to be in these forums).

Thanks-

DS
 
DS,

You could set up a Month (string) parameter and set up defaults of 1, 2, ... 12. Set up a Year (string) parameter with defaults of valid years 2005, 2006, 2007, 2008, ...

Your selection then would be:
val({?Month})= Month({TCL_SRVC.BGN_DT}) and
val({?Year})= Year({TCL_SRVC.BGN_DT})

Andy
 
If you set up the month and year parameters as numbers, you will not need to wrap them in val(). To speed this further, you could use SQL expressions to return the month and year so that the selection is passed to the database, e.g., (the syntax/punctuation would be specific to your database):

{fn year(`TCL_SRVC`.`BGN_DT`)}

The record selection would then look like:

{%Month} = {?Month} and
{%Year} = {?Year}

-LB
 
LB,

I was going to suggest using numeric parameters, but then the defaults for the drop-down look weird (2007 showed as 2,007.00 ...). I guess you could give each default a description and only show the description.

Andy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top