Tips and Tricks
 Crystal Reports Forum : Crystal Reports .NET 2003 : Tips and Tricks
Message Icon Topic: Currentdate Post Reply Post New Topic
Author Message
elton3d
Newbie
Newbie


Joined: 10 Jul 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote elton3d Replybullet Topic: Currentdate
    Posted: 04 Mar 2011 at 10:37am
Hi, I wonder if somone could help?

I am trying to use the select expert to select the next coming saturday and sunday only on the report.

I have tried a mixture of things but cant get it to work...


{date} = today + 1 and {date} = today + 2 which does not work.

I cant use an actual date as the report will need to be run every friday to retrieve sat and sun.

Any help would be great please.Smile
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 25 May 2011 at 5:14am
dateadd('d',1,CurrentDate)
IP IP Logged
rocketgirl
Newbie
Newbie
Avatar

Joined: 06 Jun 2011
Online Status: Offline
Posts: 4
Quote rocketgirl Replybullet Posted: 07 Jun 2011 at 12:57am
Hi
Hope you found an answer by now but if not,
I have used varying combinations of 'day of week' and 'current date' to set recurring reports to run on any day of a week but for the same period of days
 
for example {Date} = CurrentDate - Dayofweek(CurrentDate)
will always give you info for last Saturday
and  {Date} = CurrentDate - Dayofweek(CurrentDate)-1 will always give you data for last Friday 
regardless of what day of the week you pysically run your report
 
so {Date} = CurrentDate - Dayofweek(CurrentDate)+6 should give you this coming Saturday
 
HTH
IP IP Logged
Alexander
Newbie
Newbie


Joined: 10 Jan 2012
Online Status: Offline
Posts: 12
Quote Alexander Replybullet Posted: 11 Jan 2012 at 6:50pm
[QUOTE=rocketgirl]Hi
Hope you found an answer by now but if not,
I have used varying combinations of 'day of week' and 'current date' to set recurring reports to run on any day of a week but for the same period of days
 
for example {Date} = CurrentDate - Dayofweek(CurrentDate)
will always give you info for last Saturday
and  {Date} = CurrentDate - Dayofweek(CurrentDate)-1 will always give you data for last Friday 
regardless of what day of the week you pysically run your report
 
so {Date} = CurrentDate - Dayofweek(CurrentDate)+6 should give you this coming Saturday
 
HTH
[/QU
 
Hi,
In a crosstab monthwise i am giving date range let say from oct-2011 to till date i:e 12 jan-2012 so it is taking full month of oct, nov, dec & 12 days for current month.
 
what i want if today is 12th so it should take 1-12 of everymonth.
 
Can you please help me on this!
 
Regads
Alex
IP IP Logged
mrtj
Newbie
Newbie


Joined: 26 Mar 2013
Online Status: Offline
Posts: 26
Quote mrtj Replybullet Posted: 02 Jan 2014 at 6:28am
here works a formula to always return a date that happens to be a Thursday. If its sunday thru wednesday the first part of the if statement runs, if its fri or sat, the else part runs.

shared Datevar Thur;

if Dayofweek(CurrentDate)<=5 then
Thur:= CurrentDate - Dayofweek(CurrentDate)+5 else

Thur:= CurrentDate - Dayofweek(CurrentDate)+12;
//when the date is 1/3/14 then dayofweek is 6. 1/3/14 minus 6+12 same as 1/3/14+6 which is 1/9/14
//when the date is 1/4/14 then dayofweek is 7. 1/4/14 minus 7+12 same as 1/4/14+5 which is 1/9/14

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.047 seconds.