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

determine day of week from date/time 3

Status
Not open for further replies.

JudyTes

Programmer
Sep 14, 2005
1
CA
Hi
Is it possible to determine the day of the week from a date/time stamp field?
I'm new to Crystal Reports!
Thanks
Judy
 
Perhaps I should have elaborated a bit:

In the field explorer, right click Formulas and select New, name it, then use the code provided, replacing {table.field} with your {table.field}.

-k

 
If you're new to Crystal, you should also check DatePart, DateAdd and DateDiff. Lots of interesting things you can do very quickly, using the proper Crystal commands.

You should also give your version - 8.5, 9, 10, 11 or whatever.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi, rather than start a new thread, this seemed very related to what I am trying to do, so I thought I would add this here. Thanks in advanced!

Okay, I have v8.5.

I have time fields I want to calculate. Lets say we have:

PlannedStartTime
ActualStartTime
PlannedEndTime
ActualEndTime

I would like to do the following:
1. Difference, in minutes, between ActualStartTime and PlannedStartTime. (Note, actual may start BEFORE planned, so I would like negative and positive nmumbers to help me see which is late and early).

2. Boolean to return True/False on "Is ActualStartTime greater than or equal to PlannedStartTime + 15 minutes" (if start time is 7:00, is the actual after 7:15).

3. Similar to 2, but with ranges. For example, I would categories something that is "late" within 15 - 30 minutes, 31 - 60 minutes, 61 - 90 minutes...



 
You'll get better results starting a new thread as this topic is day of week, not time differentials, and people will see that it's already been answered and likely skip it.

Also, try posting technical information, such as the types of fields, note the original poster did so.

To calculate differences in datetime fields, use the datediff function, as in:

datediff("s",{table.datetime1}, {datetime2})

"n" is used for minutes.

Hit F1 in Crystal to check out the various other options.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top