Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: All Dates within a year Post Reply Post New Topic
Author Message
Memoli28
Groupie
Groupie
Avatar

Joined: 10 Apr 2009
Online Status: Offline
Posts: 58
Quote Memoli28 Replybullet Topic: All Dates within a year
    Posted: 07 Apr 2011 at 7:07am
Hi All,
 
Does anyone know how to insert all dates within a report by a formula?
 
example:
 
basically
date (calendar)      planned work       produced work
01-01-2011               0                         0
02-01-2011               0                          0
03-01-2011             0                          15
04-01-2011             20                        13
 
i have a datefield in the report, but not every date is included in it.
 
regards,
Mehmet                       
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Apr 2011 at 10:59am
You can't do this with a formula.  You need to have something like a calendar table that contains all of the dates in a year.  You then use that as the "base" table for your report and do a left join from that to the table that contains the data with the dates.  Use the date field from the calendar table on your report instead of the one from the data table.
 
-Dell
IP IP Logged
Memoli28
Groupie
Groupie
Avatar

Joined: 10 Apr 2009
Online Status: Offline
Posts: 58
Quote Memoli28 Replybullet Posted: 15 Apr 2011 at 12:14am
Hi Hilfy,
 
i have done the following:
 
I created an excel sheet (one column) with all the dates in year 2011.
I linked with table X.
 
however, i am struggling with the following:
 
if the field in the table X is default: 1/1/2001,  which value i have to fill in
the excel sheet so I can include this records also in my report.
 
the original value in table X is recorded as follows: 0001-01-01
in crystal translated to 1/1/2001.
 
i tried several things but no results.
 
Are you familiar with this ?
 
regards,
Memoli
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 15 Apr 2011 at 4:15am

What type of database are you using?  This may be your database's internal representation of a blank date value.  Have you tried adding 1/1/2001 to your spreadsheet?  How about a blank field?

-Dell
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.032 seconds.