displaying all missing dates (1 Viewer)

mhacky01

Registered User.
Local time
Today, 00:39
Joined
Oct 21, 2013
Messages
12
hi guys

please help me on my project about displaying all missing dates in my report?

For example, your report may look like this...
Dec. 1, 2011 pilita
Dec. 2, 2011 pilita
Dec. 3, 2011 pilita
Dec. 4, 2011 pilita
Dec. 7, 2011 pilita
Dec. 8, 2011 pilita
Dec. 10, 2011 pilita
Dec. 13, 2011 pilita
Dec. 15, 2011 pilita
Dec. 16, 2011 pilita
Dec. 20, 2011 pilita
Dec. 21, 2011 pilita
Dec. 22, 2011 pilita
Dec. 25, 2011 pilita
Dec. 27, 2011 pilita
Dec. 30, 2011 pilita

And what you'd really like to have displayed on the report is this...
Dec. 1, 2011 pilita
Dec. 2, 2011 pilita
Dec. 3, 2011 pilita
Dec. 4, 2011 pilita
Dec. 5, 2011
Dec. 6, 2011
Dec. 7, 2011 pilita
Dec. 8, 2011 pilita
Dec. 9, 2011
Dec. 10, 2011 pilita
Dec. 11, 2011
Dec. 12, 2011
Dec. 13, 2011 pilita
Dec. 14, 2011
Dec. 15, 2011 pilita
Dec. 16, 2011 pilita
Dec. 17, 2011
Dec. 18, 2011
Dec. 19, 2011
Dec. 20, 2011 pilita
Dec. 21, 2011 pilita
Dec. 22, 2011 pilita
Dec. 23, 2011
Dec. 24, 2011
Dec. 25 2011
Dec. 26 2011
Dec. 27 2011 pilita
Dec. 28, 2011
Dec. 29, 2011
Dec. 30, 2011 pilita
Dec. 31, 2011



how can i achive this?? im new on ms access how can i do this??
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:39
Joined
Aug 30, 2003
Messages
33,762
I deleted your triplicate threads; please don't post the same question multiple times.

In general, you'd have to have a table of all the dates and use a LEFT JOIN against that table. You can populate a table on the fly with the dates requested for the report.
 

mhacky01

Registered User.
Local time
Today, 00:39
Joined
Oct 21, 2013
Messages
12
Sir sorry for my dupilication....

actually i just followed the procedure...

here's re reference...

website//scn.sap.com/community/crystal-reports/blog/2011/12/13/displaying-all-missing-dates-in-a-range--a-custom-function-sample

but still i have error on formula expert

"a date is required"

can you show me how to do this sir??
 

CJ_London

Super Moderator
Staff member
Local time
Today, 08:39
Joined
Feb 19, 2013
Messages
11,777
so to understand what you want?

You want us to explain why some code, which you have not shared with us doesn't work?

I had a look at this link

http://scn.sap.com/thread/3509531

which refers to your link and there are a number of solutions, including the one proposed by Paul.
 

mhacky01

Registered User.
Local time
Today, 00:39
Joined
Oct 21, 2013
Messages
12
actually sir i have some codes of this but i get an error...

Custom Function:

Function Days_Between (datefield as date, nextdatefield as date, format as string)

dim thisdate as date
dim nextdate as date
dim output as string 'output is the text display
dim daysbetween as number
dim looptimes as number
looptimes = 0
daysbetween = 0
thisdate = datefield + 1
nextdate = nextdatefield

if nextdate - thisdate > 1 then daysbetween = nextdate - thisdate else daysbetween = 1
do
if nextdate - thisdate > 1 _
then output = output + totext(thisdate, format) + chr(10) _
else _
if nextdate - thisdate > 0 _
then output = output + totext(thisdate, format)

looptimes = looptimes + 1
thisdate = thisdate + 1
loop until looptimes = daysbetween

Days_Between = output
End Function

And this is for Section Expert for the new details section:

Days_Between ({Ship_Date.Date}, next({Ship_Date.Date}), 'MMM. d, yyyy')
 

CJ_London

Super Moderator
Staff member
Local time
Today, 08:39
Joined
Feb 19, 2013
Messages
11,777
so you are writing this in Crystal Reports?
 

mhacky01

Registered User.
Local time
Today, 00:39
Joined
Oct 21, 2013
Messages
12
yes sir... or do you have anyway? to do this??
 

CJ_London

Super Moderator
Staff member
Local time
Today, 08:39
Joined
Feb 19, 2013
Messages
11,777
I only use Crystal Reports occasionally so would not consider myself an expert. There may be others here who can help but I think you will have more success visiting a SAP or Crystal Reports user forum. Did you try the link I provided?
 

kevlray

Registered User.
Local time
Today, 00:39
Joined
Apr 5, 2010
Messages
751
I am just wondering if {Ship_Date.Date} is actually a datetime and CR is complaining about that. Doing a convert to a date in the function call should be a quick way to test.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom