473,320 Members | 1,839 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.

Between dates (dd-mm) query MS Access

HI,

I'm having a problem with the following query.

Here it is in my own words :

Table :
T_Test
id (Autonumber)
dtmStartDate (Datetime) format dd-mm
dtmEndDate (datetime) format dd-mm
intHours (number)

I want to query the T_Test table with a dd-mm value to get the right
intHours value where my dd-mm is between dtmStartDate and dtmEndDate.

Select intHours from T_Test where '25-05' between dtmStartDate and
dtmEndDate

Can someone help please?

Thanks

Alain
Nov 12 '05 #1
1 1768
A date includes a date, month, and year. While you could use the format
command to format the field and criteria the same, it would return the month
and day, regardless of year. This will probably cause you a problem when you
continue to add records next year. The criteria will work properly if you
include the year also. If you simply want the current year, you can
concatenate that in.

Select intHours from T_Test where DateSerial(Year(Date()), 05, 25) between
dtmStartDate and dtmEndDate

--
Wayne Morgan
Microsoft Access MVP
"Alain Filiatrault" <al****@humaprise.com> wrote in message
news:45**************************@posting.google.c om...
HI,

I'm having a problem with the following query.

Here it is in my own words :

Table :
T_Test
id (Autonumber)
dtmStartDate (Datetime) format dd-mm
dtmEndDate (datetime) format dd-mm
intHours (number)

I want to query the T_Test table with a dd-mm value to get the right
intHours value where my dd-mm is between dtmStartDate and dtmEndDate.

Select intHours from T_Test where '25-05' between dtmStartDate and
dtmEndDate

Can someone help please?

Thanks

Alain

Nov 12 '05 #2

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

Similar topics

3
by: David | last post by:
I'm new to DB2 and I need to write a query that will allow me to find specific dates instead of me having a date range asked for, I want it to be calculated. I've done this in Access by coding...
3
by: MMFBprez | last post by:
I am trying to compute storage charges by getting the number of months between dates and multiplying it by a rate. I cannot get a correct number of months if the date is greater than a year ago. ...
2
by: Carl | last post by:
Hi, I have a query that produces an output similar to the sample shown below. These records are based on certain criteria and a date range selected from a form. I need to create some kind of...
1
by: pitfour.ferguson | last post by:
My dbase has the start date and end date of each visit. How can I ask Access to list the day of the week of the start (easy), end (easy) and, more importantly, the dates of the visit itself - ie...
1
by: santiago | last post by:
Hello. I'm having troubles with a query that (should) return all the records between two dates. The date field is a datetime type. The db is SQL Server 2000. When I try this SELECT ...
0
by: doron.almog | last post by:
anybody know which driver to use to make a linked server connection between MSSQL 2005 and Access 2007
4
by: PerumalSamy | last post by:
Hi, i am doing program in asp.net using vb coding and MS Access as back end. i am having a table with date field and manipulation is based on the same. i am inserting value from textbox...
5
by: HowHow | last post by:
First time using crosstab query because tired of creating queries and put them together in one query (such a stupid thing to do :D). Not sure how it works still. I have link table called...
5
by: lisles | last post by:
i have a page funtion.php which hs the function to connect to the db /* Mysql Connection */ function connect(){ global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php...
0
by: sofiashaharom | last post by:
I've connected my program (developed in VB 2008) to a microsoft access (2003) database.One of the columns stored in the database is the Start_Date. The purpose of my program is to calculate the...
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: 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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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: 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.