Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Tips and Tricks
Message Icon Topic: Daily sales comparison report Post Reply Post New Topic
Author Message
refeesh
Newbie
Newbie


Joined: 09 Feb 2011
Location: Saudi Arabia
Online Status: Offline
Posts: 9
Quote refeesh Replybullet Topic: Daily sales comparison report
    Posted: 06 Jan 2015 at 2:20am
dear,

i want to make a daily comparison report with last year and current date. can you advice me how can i put formula to get this


example

item name date      today sales     last year sales
xxxxx     06-1-15        25000          27000

kindly advice me how can i get this also i need to get the weekly sales with last year the same week.
IP IP Logged
refeesh
Newbie
Newbie


Joined: 09 Feb 2011
Location: Saudi Arabia
Online Status: Offline
Posts: 9
Quote refeesh Replybullet Posted: 07 Jan 2015 at 10:42pm
kindly somebody answer me. please
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 08 Jan 2015 at 4:46am
Not sure how to get the same week.  You might be able to use the datediff function and and assume a 52 week difference.

As far as difference, once you have established the values, you should be able to subtract them in a formula.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jan 2015 at 5:40am
day:
table.date=currentdate or table.date = dateadd('yyyy',-1,currentdate)
 
weekly depends on how you are defining it but one way would be like kevray suggests.
This would give you a full week for last year and possibly a partila week for the current year
 
datepart('ww',currentdate)=datepart('ww',table.datefield) and (datepart('yyyy',table.datefield) = datepart('yyyy',currentdate) or datepart('yyyy',table.datefield) = datepart('yyyy',dateadd('yyyy',-1,currentdate)))
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.031 seconds.