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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

day and weeks

Status
Not open for further replies.

ttechie

Technical User
Feb 11, 2005
56
IN
I have a CR 10 report that pull data from sql. I am trying to get every two week of data. I have used the code below but it only gives me for some reason from 11/06/05 through 11/18/05 and in one user case it gives 10/30/05 through 11/11/05. Is there a way where I pick dates instead of just get random dates. I am very new to crystal so please bear with me.
thanks
totext({table.date}-dayofweek({table.date}) + 1,"MM/dd/yyyy") + " - " + totext({table.date}-dayofweek({table.date}) + 7,"MM/dd/yyyy").
 
I don't think that you are getting random dates, you're getting the dates that are in the database.

What does "I am trying to get every two week of data." mean?

You want the last 2 weeks of data, or you want all data from the beginning of time grouped by 2 weeks, or?

-k
 
Thanks! bud. I figured this one out myself. Thanks anyway!
 
ttechie-
It is appropriate for you to post the solution you came up with--even when you figure something out yourself--so that other users can learn from your post.

lantzmarcd-
This should have been a new thread, but anyway, you can use:

datepart("ww", {table.date})

You can read about datepart in the help section. You can also add arguments that specify the first day of the week and first day of the year.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top