Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Problem With Dates Post Reply Post New Topic
Author Message
Lord Yorkshire
Newbie
Newbie
Avatar

Joined: 04 Jul 2010
Online Status: Offline
Posts: 28
Quote Lord Yorkshire Replybullet Topic: Problem With Dates
    Posted: 20 Oct 2010 at 11:34pm
I have a report that shows when a machine operator makes a comment on our shop floor data capture system.
 
The time that it records the comment against is held as a number. e.g 65642438
 
We convert that number to a date using this formula
 
cdatetime(round({sfcomments.amend-time}/86400,5)+32874)
 
I want to be able to select the comments made from 7am yesterday to 7am today (3 shifts) and run this report automatically, everyday at 8 oclock ready for our monring production meeting.
 
Is there a way of converting 7am today back to the number so i can say select comments between 7am yesterday and 7am today.
 
or is there a better way of doing what i need.
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Oct 2010 at 4:14am
assuming that your code properly converts the day as well as time
 you can try this:
 
cdatetime(round({sfcomments.amend-time}/86400,5)+32874) in
(currentdate-1 + time(7,0,0)) to (currentdate + time(7,0,0))
IP IP Logged
Lord Yorkshire
Newbie
Newbie
Avatar

Joined: 04 Jul 2010
Online Status: Offline
Posts: 28
Quote Lord Yorkshire Replybullet Posted: 21 Oct 2010 at 5:00am
Thank you. That has worked and my report shows the correct information.
 
Much Appreciated
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.035 seconds.