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

Creating Time Ranges without using prompts

Status
Not open for further replies.

Tubby6

Technical User
Jun 4, 2007
26
CH
Hello I would like some help in creating a report that results the following requirements:

1. Displays results From Wednesday to Wednesday from 4PM -12 PM only.

I have created a prompt with I cannot use and I would like some help in how to go about this..
I had chosen in Select Expert "Last7Days" But. that gives me all results and does not give me last 7 days ONLY between these two time intervals.
help.
 
If you always run it Wednesday, you could do
Code:
{your.datetime} >= currentdate-7
and
Time({your.datetime}) in [4 to 12]
If you want to run it on other days, adjust using
Code:
DatePart ("w", {date1})
Put this as a formula field and it gives a number, 1 to 7. The default is Sunday as 1 and Saturday as 7, though you can change this using firstDayOfWeek. From there you can adjust the range to be Wednesday.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc

I'm using Crystal v10.. So i went ahead and used the first formula you gave me.. But.. an error message pops up saying that a date time is required in [4 to 12]


{HPD_HelpDesk.Create Time} >= currentdate-7

and

Time({HPD_HelpDesk.Create Time}) in [4 to 12]
 
Sorry, it should be in [Time(4) to Time(11)]

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I went ahead and changed [4 to 12] to [16 to 00] as i felt that perhaps that was the problem. but it still prompts "time range is needed"...

is there anything that can be done to fix this problem?
your help is much appreciated
-tubby
 
i went ahead and changed the previous entry to the following

{HPD_HelpDesk.Create Time} >= currentdate-7

in [Time(4) to Time(12)]


... it says that a boolean array is needed now.
i also tried

{HPD_HelpDesk.Create Time} >= currentdate-7

and Time ({HPD_HelpDesk.Create Time}) in [Time(4) to Time(12)]


but unfortunately i obtained no results.. but that I know that there are results.. I feel I'm doing something completely wrong.

your help is greatly appreciated
-tubby
 
Put the two tests as formula fields - they should return True or False. Remove selection. Put the tests beside the data and see what you get.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top