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

DateTime objects

Status
Not open for further replies.

diannelight

Technical User
Feb 24, 2003
59
US
I have a DateTime object that I would like to display as 'Day' - I've used the DatePart function to do this. However, I am having trouble grouping the 'day' information together. (Am assuming that this because hh:mm:ss is not the same?)
Can you help?
Thanks!
 
Your assumption is correct.

CDate({DateTimeField})

and group on that.
 
Hi Naith,
I've tried that but it doesn't group the days together - any other suggestions?
 
hi

is your group base on that field you have converted?

pgtek
 
hi
in your group selection in the option section do you have keep group together check

pgtek
 
Please post your actual DatePart command. It ought to work, so we need to see the specifics.

Also which version of Crystal.

Madawc Williams
East Anglia, Great Britain
 
DatePart ("d", {ReporterIndex_1_0_0_0_ttx.Dates: Breakdown})

Using Crystal Version 8.5

'Keep Group Together' is checked.

I think my problem lies in the fact that I have a higher group which uses a range to filter the groups ie. I have parameters that ask for 'DDI number from' and 'DDI number to' and I then group by DDI, Day. (So, it's grouping by DDI first).

I have tried a subreport but the report errors.
 
I would not pursue the idea of grouping on the DatePart formula. If you have September 1 and August 1 in the same dataset, the DatePart function will return 1 for both, and stick them in the same group.

I expect that you're getting numerous occurences of the same day in different DDI groups, as the days are being split because of their DDI difference.

If you have numerous occurences of the same day in the same DDI groups, then that would be an issue with the time section of your field. This should be unlikely as using the CDate function makes the time redundant.

Naith
 
I've managed to group it correctly by changing the order of the two groups ie. group by breakdown first then DDI.
It works but I'm unsure why, & I've also managed to group it on DatePart.
Thanks for all the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top