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

Displaying 11 prior dates along with current date

Status
Not open for further replies.

Lnxvas

Programmer
Oct 15, 2008
15
0
0
US
i have a report where i have to display 11 prior date along with the current date.

how my report works is i give a parameter say idnum .this idnum picks the customerid and the date. the customerid has several dates and for each dates they r different idnum for the same customerid.(for example
date colum idnum customerid
04/01/2008 009 0000289
06/01/2008 109 0000289
04/01/2007 110 0000289 etc)

so when i give idnum 009 then it should pull the date 04/01/2008 plus 11 prior to that date.

i am already using a formula for the date display (it has time also) that is dateadd("h",1,{Command.STARTTIME})

can this be possible in report with help of a formula or should i work on query?


Thanks a bunch,



 
You'll need to use DateAdd, which can have minus values and "d" for adding or subtracting days.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You can do it with 11 distinct commands. No short-cuts I can think of.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks, Madawc
yes ,i can do that but my problem is...

may be i am not clear in my question before what i want is the currrent value(ie date)along with the 11 prior values(these r also dates) but the problem is the dates r not in order. they r like... 04/02/2008,..,..,..,..,..,.,05/02/2008,12/02/2007,03/01/2007,08/01/2008 so when i give date 08/01/2008 then i should be able to display
08/01/2008,
03/01/2007,
12/01/2007,
05/02/2008,
..,..,..,till
04/02/2008 so values displayed will be 12 values in total

can this be possible in the report?
 
If the dates are not in order, then what exactly determines what is a "prior" record? What field determines that, if it isn't the date? Is it the IdNum? But that doesn't seem to be sequential either.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top