Home > Archive > MS Access Multiuser > May 2005 > finding the value in a field in the nth row of a recordset









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author finding the value in a field in the nth row of a recordset
Bill Reed via AccessMonster.com

2005-05-09, 8:25 pm

I have a query that returns a recordset consisting of the workdays between
2 given dates. It gets the data from a table of calendar dates I put
together which shows every date between 1/1/2000 and 12/31/2025. There are
2 columns in the table. The first contains the calendar date and the 2nd,
"BusinessDay", contains either "Saturday", "Sunday", "Holiday", or Null.
So to get a count of workdays between any 2 dates, all I have to do is
return a recordset from the table where "BusinessDay" is null and get the
recordcount.
That works fine.

Now I want to return a recordset consisting of all the records > or < any
given date where "BusinessDay" is null and go to a specific record, say
record # 25, and find out the date on the 25th workday from the given date.

Any suggestions?

Thanks,

Bill

--
Message posted via http://www.webservertalk.com
Alex Dybenko

2005-05-10, 7:24 am

Hi,
i think you can run a query: Select top 25 date from yourtable where date >
[given date] and BusinessDay is null order by date DESC
and get it first record - this will be a 25th business day

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


"Bill Reed via webservertalk.com" <forum@nospam.webservertalk.com> wrote in
message news:2a5337e8349a4ed
b99aba8d63e79946d@we
bservertalk.com...
>I have a query that returns a recordset consisting of the workdays between
> 2 given dates. It gets the data from a table of calendar dates I put
> together which shows every date between 1/1/2000 and 12/31/2025. There are
> 2 columns in the table. The first contains the calendar date and the 2nd,
> "BusinessDay", contains either "Saturday", "Sunday", "Holiday", or Null.
> So to get a count of workdays between any 2 dates, all I have to do is
> return a recordset from the table where "BusinessDay" is null and get the
> recordcount.
> That works fine.
>
> Now I want to return a recordset consisting of all the records > or < any
> given date where "BusinessDay" is null and go to a specific record, say
> record # 25, and find out the date on the 25th workday from the given
> date.
>
> Any suggestions?
>
> Thanks,
>
> Bill
>
> --
> Message posted via http://www.webservertalk.com



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com