# Thread: date formula problem...

1. Registered User
Join Date
Oct 2011
Posts
8

## Unanswered: date formula problem...

hi

this is pavan...i am new to crystal reports....i have a doubt..i tried to write a formula for a :

members scheduled for an interview within 10 business days and i should exclude sundays in this...

the formula is

- (CASE WHen DATENAME(dw,b.startdate)='SUNDAY' THen 1 else 0 end)
- (CASE when DATENAME(dw,b.endadate)='SATURDAY' then 1 else 0 end)

but the formula is not working...can anybody suggest me...

2. Registered User
Join Date
Oct 2010
Posts
46
Originally Posted by pavansap
members scheduled for an interview within 10 business days and i should exclude sundays in this...

- (CASE WHen DATENAME(dw,b.startdate)='SUNDAY' THen 1 else 0 end)
- (CASE when DATENAME(dw,b.endadate)='SATURDAY' then 1 else 0 end)
1. Check your syntax

DateDiff

DateDiff returns a number of time intervals between two specified dates

Syntax:

DateDiff (intervalType, startDateTime, endDateTime)
DateDiff (intervalType, startDateTime, endDateTime, firstDayOfWeek)

• intervalType is a String expression that is the interval of time you use to calculate the difference between startDateTime and endDateTime.
• startDateTime is the first DateTime value used in calculating the difference.
• endDateTime is the second DateTime value used in calculating the difference.
• firstDayOfWeek is an optional constant specifying the first day of the week.

Returns
A Number value

2. Elaborate on what you want to do

Don't know why you are finding date difference for "members scheduled for an interview within 10 business days and i should exclude sundays in this". If you can explain what you want to do, maybe someone can help.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•