473,386 Members | 1,698 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,386 software developers and data experts.

Generating a 2 week report with a query.

12
Hi all...

Expanding on my operator database I want to run a bi-weekly report for pay purposes.

NeoPa kindly gave me this code when solving my last problem:
Expand|Select|Wrap|Line Numbers
  1. SELECT CDate([Enter Date Here :]) AS SelectDate, Jobs.ID, 
  2.        Ops.[First Name], Ops.[Last Name], Ops.[Mobile Tel], 
  3.        Jobs.[Site Name], Jobs.[Site Address]
  4. FROM Ops INNER JOIN Jobs ON Ops.ID = Jobs.ID
  5. WHERE (CDate([Enter Date Here :]) Between [Jobs]![Date Start] And [Jobs]![Date End]);
The code calls on the same tables and field, but I would like the query to pull from a date to another date, picking up each indivdual day that the operator is out, based on the Start and end Date in the Jobs database.

So for example:

If J. Doe has a job on the database Starting from 01/01/07 to 06/01/07 and is it at all possible to have it list the individual days that he was out?
Jan 30 '07 #1
4 1743
MrChris
12
I've had a think about it and I feel I need to clarify.

I need the same query to work on date ranges,

Whereas this current code asks for one date... I would like it to ask for 2 dates and do the same job, pulling a report as to who is where on each day in the range specifed by the user.

Expand|Select|Wrap|Line Numbers
  1. SELECT CDate([Enter Date Here :]) AS SelectDate, Jobs.ID, 
  2.        Ops.[First Name], Ops.[Last Name], Ops.[Mobile Tel], 
  3.        Jobs.[Site Name], Jobs.[Site Address]
  4. FROM Ops INNER JOIN Jobs ON Ops.ID = Jobs.ID
  5. WHERE (CDate([Enter Date Here :]) Between [Jobs]![Date Start] And [Jobs]![Date End]);
Jan 30 '07 #2
NeoPa
32,556 Expert Mod 16PB
This is not so straightforward :(
Here (Find Missing Dates in Query) is a link to a thread I'm currently involved with that deals with just this issue. It will certainly help, if only to help you understand better how complicated it is ;)
Jan 31 '07 #3
MrChris
12
Crikey that certanly looks like like a right old head scrather...

Maybe I can simplify my question then.

Can it be done do that when I enter the date into the query (as before) and it does what it did before... but for a flat 14 days from the date specified

so if I enter 01/01/07 it displays from 01/01/07 to 14/01/07?
Jan 31 '07 #4
NeoPa
32,556 Expert Mod 16PB
This would need the same basic construct I'm afraid. There are probably ways to do this in a code loop but to use SQL the dates need to be available in a data source (Table) first, before they can be accessed.
Jan 31 '07 #5

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

Similar topics

2
by: Ryan | last post by:
We have an MIS system which has approx 100 reports. Each of these reports can take up to several minutes to run due to the complexity of the queries (hundreds of lines each in most cases). Each...
2
by: Papegoja | last post by:
Hi, A week ago I had a question how to get MS Query to return a standard date to a "YEAR-MONTH" (YYYY-MM) format. I received a great answer from Jerry Boone!!! It follows: SELECT...
5
by: Peter Bailey | last post by:
I have a query that returns , and : 12/05/04 3 Wednesday 13/05/04 0 Thursday and so on what I would like to do now is count the number of bookings by week so from monday to...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
3
by: Patonar | last post by:
Hi, I have a query which works out which orders are due to be delivered in a particular week. I would like to display this by week commencing which i can do with the following WHERE condition in...
10
by: Jim | last post by:
I'm sure this has been asked before but I can't find any postings. I have a table that has weekly inspections for multiple buildings. What I need to do is break these down by the week of the...
7
by: derekdeben | last post by:
Hi, I have created a report that totals the number of days it took a product to ship by percentage by a date range for a specific location. My data comes from a query with the following headers: ...
5
by: Cyrax1033 | last post by:
I have yet a new issue that is the only factor stopping me from adding on the last feature to the database; all help is very much appreciated! In my database is are two tables: one for inserting...
0
by: Minckeleers | last post by:
hello everyone, I'm pretty new in VB, moderate experience in Acces but I need to get a 'universal' code for generating reports from a table or query. It has to automatically create a report...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.