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

Date parameter to show just month

Status
Not open for further replies.

AuctionLamb

Programmer
Feb 16, 2005
65
ZA
Hi guys!!

I use 2 date parameters in Crystal Reports(v8.5), but I do NOT want to show them the dates just the months. For example first parameter would be Jan 2005 and second parameter March 2005. How can I do this? Is it possible?

THANKS!
Shaun
 
Might post more technical information for a more precise answer

Crystal Version (Different version have different alternative)
Database and connectivity (different databases have different solutions)
Sample data (what are we looking at)
Expected output (What are you expecting as output)

If the format is for display purpose, then simply right click on the data object->format object click on the date tab and click on Customize to format the date you want.

If grouping by date in monthly increments, then reformat the date same as above.

When you say parameter, is this month and day entered by the user? If so how? As a number or date.

-lw


 
It is month/day entered by the user, so I need to know how to show only the month.
 
You could ask for a numeric parameter in the form MMYY or MMCCYY. Then test it against date-parts: Month({your.date}) and Year({your.date}).

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
When you say Month and day, do we assume this year? What happens if today is Jan 2, 2005 and the user specifies Dec 26, what do you want done? I would assume 2004.

Here's what I have done using Crystal 8.5 with an Oracle Database

{?StartDt} is user input parameter.
{?EndDt} is user input parameter

Although both have the day of month in it, the following record selection will only select records based on year and month. It is also fewer mouse clicking than having separate numbers parameters to identify the month and year. Been there. Done that.

Code:
{table.date} in dateserial(year({?startDt}},month({?startdt}),1) to dateserial(year({?EndDt}),month({?EndDt})+1,1-1)


Cheers,
-lw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top