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

Need help with Year and Date Functions

Status
Not open for further replies.

ikards

Technical User
Jun 16, 2000
9
US
I have a parameter that is a date range: {?Rpt Date Range}. I want to use the Year function to isolate just the year, so I set up a formula for variable "Year1": Minimum(?Rpt Date Range). I want to then substiture the "Year1" variable in the Date Function in place of the YYYY argument). Ex: IF {Slip.Slip.Date} in Date(Year1,1,1) to Date(Year1,1,31)... First question: CAN I use a variable in the place of the YYYY argument? And if I can, I am concerned about the format of the "Year1" variable. If I print it on the report for testing purposes, it appears as "2,002.00". Second question: Do I need to convert "Year1" variable to "2002" before using it as the substitute for YYYY? And if so, how can I convert it to just "2002"? Thanks for your help!

-- Steve Ikard
 
You can use a variable to do this, and you do not need to be worried about the decimal places or the comma. However there is no NEED to use a variable, just put the entire expression in your If-Then formula:

If {Slip.Slip.Date} in
Date(Year(minimum({?DateRangeParm}),1,1) to
Date(Year(minimum({?DateRangeParm}),1,31) then .....




Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Thanks SO much for the reply, dgillz, whoever you are. You saved the day! It worked like a champ once I fixed the missing parentheses. Thanks, again. This forum is invaluable!

-- Steve Ikard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top