Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count number of weeks/month 1

Status
Not open for further replies.
Jul 23, 2002
26
Hi,

I'm wondering if it's possible in crystal 11 to count the number of weeks or month between two dates. Would this be done in a formula or does crystal have a built in funtion for something like this?

Thanks,
Joe
 
Sure, just use the Datediff function, as in:

DateDiff ("w", {table.date}, currentdate)

The parameters available are:

yyyy
Year

q
Quarter

m
Month

y
Day of year

d
Day (both "y" and "d" find the difference in days)

w
Number of weeks between startDateTime and endDateTime

ww
Number of firstDayOfWeek's between startDateTime and endDateTime

h
Hour

n
Minute

s
Second

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top