473,320 Members | 2,003 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,320 software developers and data experts.

Query between dates

I have two tables. One with a list of various dates and other data,
the other with a Period No (1, 2, 3, etc) and then a start and end
date field.

I feel sure it should be fairly easy to do a query which identifies
which period each record is in.

In Excel I would use a Vlookup function, and I've been trying to use
Dlookup, to no success.

Any suggestions would be greatly appreciated.

Thanks
Martin

Mar 12 '07 #1
2 4894
You can write something like:

SELECT tblData.relevantField, tblPeriod.periodName FROM tblData,
tblPeriod WHERE tblData.datefield BETWEEN tblPeriod.periodDateStart
AND tblPeriod.periodDateEnd

On Mar 12, 3:10 pm, mkenna...@yahoo.co.uk wrote:
I have two tables. One with a list of various dates and other data,
the other with a Period No (1, 2, 3, etc) and then a start and end
date field.

I feel sure it should be fairly easy to do a query which identifies
which period each record is in.

In Excel I would use a Vlookup function, and I've been trying to use
Dlookup, to no success.

Any suggestions would be greatly appreciated.

Thanks
Martin

Mar 12 '07 #2
That's exactly what I need; I felt sure it wasn't too complicated, but
have been going round in circles for ages trying to work it out!

Many thanks for your help.
Martin

Mar 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: paii | last post by:
I have a table that stores job milestone dates. The 2 milestones I am interested in are "Ship Date" TypeID 1 and "Revised Ship Date" TypeID 18. All jobs have TypeID 1 only some jobs have TypeID 18....
8
by: DH | last post by:
Say I have a table with two columns that matter to this example, and . And here is an example of what the rows currently look like: , 1,6/27/2001 1,6/27/2001 1,5/31/2001 2,6/27/2001...
8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: Mike Cooper | last post by:
Hi everyone, This is a tough one. I have a database full of solicitations, identifying a customer and recording initial call, first followup, second followup, etc. My boss want to be able to...
6
by: Bill R via AccessMonster.com | last post by:
I have a query: SELECT tblCalendar.CalendarDay AS LastSunday FROM tblCalendar WHERE (((tblCalendar.CalendarDay)>=(Now()-7) And (tblCalendar.CalendarDay)...
2
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result....
2
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and...
13
newnewbie
by: newnewbie | last post by:
I have an Access database that I upload a data extract intoto daily. I want to create a query that will give me a list of dates that no data can be found for. E.g. there are no records created on the...
5
by: veaux | last post by:
I'm thinking this is easy but can't get it. I have a table with following: Table1 Date 1/1/2007 Table2 Type 0107 (This is MMYY of above) So I'm having trouble using a query to turn the...
2
by: markcarroll | last post by:
I have a rather complicating query (the SQL is about a page long) so I hope I can solve this without needing to get into specifics. Basically, the database I am working on has information about...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.