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

Pulling Dates from CR5 with VB

Status
Not open for further replies.

bettaa

IS-IT--Management
Feb 28, 2006
20
0
0
US
I have written a report in CR5 (my boss is stuck with some old software) that basically takes patient birthdays along with names and addresses and displays them month by month in one single report. This is the formula that I used:

Date(2006,month({Patient.Birthdate}),day({Patient.Birthdate}))

The problem that I am having when I call on the report in VB I need a way to actually call on an individual month and display a month's worth of data between 2 dates, like 1/1/2006-1/31/2006. Any suggestions to how I could edit/add to the formula to make this a little more VB friendly?
 
I don't know how to do this within VB, but in CR you could set up a parameter for the month {?month} and then use a record selection formula like:

month({table.birthdate}) = {?month}

Note that your formula above will fail if someone's birthday is 2/29, unless you use a static year that IS a leap year, e.g., 2004. Not likely, but could happen--it just happened in a report I was editing for someone else.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top