473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Is looping the best way to do this?

10
I have a date parameter for a query that I'm using to update a table. I need to run the query several times using a different date each time its run. The dates are pay period end dates that are based on a date range that a user enters on a form. For example, a user enters a date range of 01/01/2007 - 03/01/2007 the pay period end dates in that period may be

01/05/07
01/16/07
02/01/07, etc.

The dates are stored in a table as follows

Pay_Start_Date, Pay_End_Date

How do I set this up so that each time the query runs it moves to the next record until it reaches the last date in the table?

Thank you
Access 2003
Aug 1 '07 #1
2 1216
Hi, how are you using the dates returned by the query? will a between clause in your query suffice? for example

update tableA
set a1=value, a2=value........
where mydate between d1 and d2;

here d1 and d2 would correspond to the values your user enters.

nanda


I have a date parameter for a query that I'm using to update a table. I need to run the query several times using a different date each time its run. The dates are pay period end dates that are based on a date range that a user enters on a form. For example, a user enters a date range of 01/01/2007 - 03/01/2007 the pay period end dates in that period may be

01/05/07
01/16/07
02/01/07, etc.

The dates are stored in a table as follows

Pay_Start_Date, Pay_End_Date

How do I set this up so that each time the query runs it moves to the next record until it reaches the last date in the table?

Thank you
Access 2003
Aug 2 '07 #2
zags
10
For each employee a the total number of hours worked for the pay period (pay period end date) by pay code is produced using each date.

For instance employee 68 for the pay period ending 01/05/2007 worked 80 hours REG, 8 OVT. This information is this posted to a table which is eventually distributed to a user.

So if there were 5 pay periods within the user entered date range the query described above would need to be run for each date separately.

I hope this answers your questions

Thanks
Aug 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: kaptain kernel | last post by:
i've got a while loop thats iterating through a text file and pumping the contents into a database. the file is quite large (over 150mb). the looping causes my CPU load to race up to 100 per...
2
by: Will Stuyvesant | last post by:
How to loop without using a looping construct; or a generator without "yield". ----- file: generatory.py -------------------------------- import receiver maxx = 10 def send(x): if x >=...
4
by: David | last post by:
Hello. I am looking for advice on what is "best practice" regarding looping through a form to check its checkboxes and associated data fields. Here is what I am trying to do (Here is the page...
27
by: Mike P | last post by:
I will be passing my function a two dimensional array of varying length. Within that array is one data point, and the number of times it should loop through. So, for example, I might pass this...
45
by: Trevor Best | last post by:
I did a test once using a looping variable, first dimmed as Integer, then as Long. I found the Integer was quicker at looping. I knew this to be true back in the 16 bit days where the CPU's (80286)...
4
by: ={ Advocated }= | last post by:
Hi there, im in need to use a loop, im not sure exactly how to do it :S ######################## /* * File: Payroll.c * Program to calculate the wage of a user */ #include <stdio.h> int...
2
by: Bruce Whitehouse | last post by:
This should be an easy one, but I'm not sure the best way to do it. I've got a form, and when I click a button it starts looping through an array. With each iteration of the array I want it to...
6
by: Luke - eat.lemons | last post by:
Hi, Im pretty new to asp so all light on this question would be great. Basically i need to test to see what value is set (where to retrieve the data from) so ive done it like this: If...
8
by: Tommy Grav | last post by:
I have a list: a = I want to loop over a and then loop over the elements in a that is to the right of the current element of the first loop In C this would be equivalent to:
1
by: Robocop | last post by:
Having just started using C again after some years off, i've been stumped by a problem i think someone more experienced could probably solve pretty easily. I have these 4 objects (vectors), and i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.