473,516 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1780
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
13479
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 visual basic scripts and making monthly reporting automatic. No longer having to change 15 queries to match specific date ranges for the previous...
3
3336
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. Here is the formula I am using now to get the number of months: #ofMonths: Month(.-.)-1. It has worked for me until now because it never was...
2
2082
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 calcualtion or record manipulation to do the following: I need to subtract dates from one another, for example for ID 1 I want to find the...
1
15552
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 list the dates between the start and end date. Basically I am doing a day of the week analysis and need to know which day of the week is busiest.
1
4724
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 RESERVES.RES_ID, PAYMENTS_RECEIVED.PYR_ID, PAYMENTS_RECEIVED.PYR_VALUE, PAYMENTS_RECEIVED.PYR_DATE, CUSTOMERS.CUS_NAME FROM RESERVES LEFT OUTER JOIN...
0
1617
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
2006
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 using sql query as follows ex: Textbox1.text="10-04-2007" (ie. in dd-MM-yyyy format)
5
5041
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 dbo_Roster to access 2000, I try to group data by Service and dates, for example 01/01 to 01/31 is Jan08, 01/02 to 28/2 is Feb08 and so on. The result should...
5
9113
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 $conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed"); @mysql_select_db($db) or die("Database Selection...
0
1237
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 number of dates in the access db according to the month. for example, the start_date for a project is 20/04/2010. therefore there is one project that...
0
7182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7581
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7142
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5714
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.