Print Page | Close Window

date parameter - Month only

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11287
Printed Date: 01 May 2024 at 9:04pm


Topic: date parameter - Month only
Posted By: Ariel
Subject: date parameter - Month only
Date Posted: 30 Sep 2010 at 9:39am
I have a report that I set up with basic begin/end date parameters but the user wants to just enter a Month in the parameter and pull any record that is within that month (regardless of the year or day).  Is that possible?  If so how do I do it?
TIA!
Ariel



Replies:
Posted By: DBlank
Date Posted: 30 Sep 2010 at 9:53am

do they want to enter a month name or number?

either way create a parameter (numeric or text depending on the answer above answer)
in your select expert for a number version
month(table.datefield)={?Param}
 
in your select expert for a text version
monthname(month(table.datefield))={?Param}


Posted By: Ariel
Date Posted: 30 Sep 2010 at 10:18am
This is what I'm entering in Select Expert:
month({TCIA_Company.ACCRED_SINCE}={?Month})
and I'm getting a "this needs a date" error :(


Posted By: DBlank
Date Posted: 30 Sep 2010 at 10:20am
move the parenth...
month({TCIA_Company.ACCRED_SINCE})={?Month}


Posted By: Ariel
Date Posted: 06 Oct 2010 at 5:11am
thank you!  That worked perfectly!  Smile



Print Page | Close Window