Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: CurrentDate Post Reply Post New Topic
Page  of 2 Next >>
Author Message
mikethemod
Newbie
Newbie
Avatar

Joined: 20 Oct 2011
Location: Canada
Online Status: Offline
Posts: 8
Quote mikethemod Replybullet Topic: CurrentDate
     Posted: 20 Oct 2011 at 2:53am
Good day everyone
 
I have a designed a crystal report that records slot machine activity by hour the report is working fine with CurrentDate the only problem I have is that this reports the currentDate from 12 am to 12 am what I need is for it to do 4am to 4am witch is our gaming day.
 
I have been racking my brain trying to come up with a way to do this but have not been sucessful thus far any suggrestions would be greatly appriciated.
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2011 at 4:51am
when do you run the report (every hour, twice a day, once a day, etc. ?)and what do you expect to see on that specific run?
IP IP Logged
mikethemod
Newbie
Newbie
Avatar

Joined: 20 Oct 2011
Location: Canada
Online Status: Offline
Posts: 8
Quote mikethemod Replybullet Posted: 20 Oct 2011 at 5:04am
it will run every hour the user just needs to refresh no perameters need to be added.
 
what I want is to be able to state currrentdate but have 4am to 4 am in stead if 12 to 12
 
Basicaly always run the current date as 4 to 4 and not 12 to 12
 
this is the current way I am doing it.
 
{HC_PRIME_REPORTDATA.dtTime} in currentdate


Edited by mikethemod - 20 Oct 2011 at 5:11am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2011 at 6:24am

date(dateadd('h',-4,{HC_PRIME_REPORTDATA.dtTime})) = dateadd('d',
(if currenttime in time(0,0,0) to time(4,15,0) then -1 else 0),currentdate)

this gives you 15 minutes window from 4 to 4:15 to run the report for the whole previous day
IP IP Logged
mikethemod
Newbie
Newbie
Avatar

Joined: 20 Oct 2011
Location: Canada
Online Status: Offline
Posts: 8
Quote mikethemod Replybullet Posted: 20 Oct 2011 at 6:28am
Hey Thank you very much I think that worked
IP IP Logged
mikethemod
Newbie
Newbie
Avatar

Joined: 20 Oct 2011
Location: Canada
Online Status: Offline
Posts: 8
Quote mikethemod Replybullet Posted: 22 Oct 2011 at 8:18am
hey this works great for current but now my boss wants me to add the prviouse weeks totals also.
 
bacicaly this report now runs every hour and auto emails to all managers.
 
basically it sends out the following:
 
CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12
this is all for current date and time now they want me to add the same info from the same day and time last week
I figured I can use this report as a base and just change up the following formaul but this is a bit more over my head how would I change this formaul to report current time but for a date 7 days ago.
 
date(dateadd('h',-4,{HC_PRIME_REPORTDATA.dtTime})) = dateadd('d',
(if currenttime in time(4,0,0) to time(4,15,0) then -1 else 0),currentdate)
 
I would just create a subreport and use that as prevouse weeks
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Oct 2011 at 1:24pm
I wouldn't use a sub report but that is up to you

date(dateadd('h',-4,{HC_PRIME_REPORTDATA.dtTime})) = dateadd('d',
(if currenttime in time(4,0,0) to time(4,15,0) then -1 else 0),currentdate)
Or
date(dateadd('h',-4,{HC_PRIME_REPORTDATA.dtTime})) = dateadd('d',
(if currenttime in time(4,0,0) to time(4,15,0) then -8 else
-7),currentdate)
IP IP Logged
mikethemod
Newbie
Newbie
Avatar

Joined: 20 Oct 2011
Location: Canada
Online Status: Offline
Posts: 8
Quote mikethemod Replybullet Posted: 22 Oct 2011 at 1:39pm
this is very close to what I am looking for only probelm the day shows me two values one for 15th and one for 16 I assume this is becasue if the 12 to 12 day, so my report shows great until after mid at this point it shows the total till 12 and starts a new total
it would be much easier of our gaming days where real days but they are 4am to 4am
I will post a pic of what I mean shortly
IP IP Logged
mikethemod
Newbie
Newbie
Avatar

Joined: 20 Oct 2011
Location: Canada
Online Status: Offline
Posts: 8
Quote mikethemod Replybullet Posted: 22 Oct 2011 at 1:49pm
CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12
CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12
CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12
CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12
i am having issues pasting so i edited a post above to ilistrate
CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12
IP IP Logged
mikethemod
Newbie
Newbie
Avatar

Joined: 20 Oct 2011
Location: Canada
Online Status: Offline
Posts: 8
Quote mikethemod Replybullet Posted: 22 Oct 2011 at 1:55pm
CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12

above is what the report looks like up until 12 am after 12 it looks like this

CoinIn CoinOut JackPots Win
$XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12

      $XX6,469.87 $XX,615.45 $XX,515.30 $XX,339.12
the first line is the figures up to 12 then next line is the figures 12 to 4 am I need to add these to get the right amoumt
 
this report is made to run every hour and as I said works great till midnight then it stops one date and adds a new line for the next date and it does this till the 4 am
IP IP Logged
Page  of 2 Next >>
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