473,803 Members | 3,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date Function

I have a query with a field named RECEIVED in which I have the
following criteria:
=DateAdd('d' ,-Day(Date())+1,D ate())


This Criteria returns all records which show a starting with the 1st
day of the current month.

I would now like to restrict this criteria only to the records showing
a date within the month range (ex. from 11/01/2003 until 11/30/2003).
It should not show records with a date later that the curren month.

Thanks.
Nov 12 '05 #1
3 6978
Paolo previously wrote:
I have a query with a field named RECEIVED in which I have the
following criteria:
=DateAdd('d' ,-Day(Date())+1,D ate())
This Criteria returns all records which show a starting with the 1st
day of the current month.

I would now like to restrict this criteria only to the records showing
a date within the month range (ex. from 11/01/2003 until 11/30/2003).
It should not show records with a date later that the curren month.

Thanks.


Watch word wrap:
= dateserial(year (date), month(date()), 1) and < dateserial(year (date),

month(date())+1 , 1)

Regards

Peter Russell
Nov 12 '05 #2
Between DateAdd('d',-Day(Date())+1,D ate()) And
DateAdd("m", 1, DateAdd('d',-Day(Date())+1,D ate()))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paolo" <jp***@tin.it > wrote in message
news:9f******** *************** **@posting.goog le.com...
I have a query with a field named RECEIVED in which I have the
following criteria:
=DateAdd('d' ,-Day(Date())+1,D ate())


This Criteria returns all records which show a starting with the 1st
day of the current month.

I would now like to restrict this criteria only to the records showing
a date within the month range (ex. from 11/01/2003 until 11/30/2003).
It should not show records with a date later that the curren month.

Thanks.

Nov 12 '05 #3
Thanks Allen, I have used your code but still was showing dates
referred to the next month. What I did was just change the last +1 to
-1 and works:

Between DateAdd('d',-Day(Date())+1,D ate()) And DateAdd("m", 1,
DateAdd('d',-Day(Date())-1,Date()))

"Allen Browne" <al*********@Se eSig.invalid> wrote in message news:<3f******* *************** @freenews.iinet .net.au>...
Between DateAdd('d',-Day(Date())+1,D ate()) And
DateAdd("m", 1, DateAdd('d',-Day(Date())+1,D ate()))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paolo" <jp***@tin.it > wrote in message
news:9f******** *************** **@posting.goog le.com...
I have a query with a field named RECEIVED in which I have the
following criteria:
=DateAdd('d' ,-Day(Date())+1,D ate())


This Criteria returns all records which show a starting with the 1st
day of the current month.

I would now like to restrict this criteria only to the records showing
a date within the month range (ex. from 11/01/2003 until 11/30/2003).
It should not show records with a date later that the curren month.

Thanks.

Nov 12 '05 #4

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

Similar topics

2
5227
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much appreciated. TIA
8
2673
by: peashoe | last post by:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them to select today. example: var dtToday = Date() if(document.frmSoftware.txtDDate.value == dtToday) {
30
3699
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code seems unnecessarily long. For some while, the following approach has been given here :- function ValidDate(y, m, d) { // m = 0..11 ; y m d integers, y!=0
1
2807
by: Liz Malcolm | last post by:
Hello and TIA. I have a DE form with an option group that if daily is selected todays date is used for start and end date, if weekly is selected Monday - Friday is used. I am trying to add a manual date selection to clear the start and end date to allow the end user input other days. I have taken into account our financial 1st and last day of the month. I was able to break the option group into a select case, but I cannot get the date...
10
11972
by: John Morgan | last post by:
Does anyone know what parameter should be used instead of Date = 0 for the optional parameter in the following function? Public Function dhAge(ByVal dtmBD As Date, Optional ByVal dtmDate As Date = 0) As Short
12
29478
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
6
12564
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a calendar control to allow my users to enter a date but I need them to enter a time as well. It doesn't look like the calendar control will allow times to be entered so I was thinking of having two text boxes. One text box would contain the date...
3
3443
by: dave | last post by:
I need to compute an expiration date based on the number of hours, days, or months purchased. The expiration date needs to be expressed in minutes something like '1260481600'. How can I get the current date and time expressed in minutes? Once I have this number I can add the number of minutes purchased to the current date/time to get the expiration date.
10
2552
by: Jes | last post by:
Dear all I have a date field on a HTML form where the user is asked to key in dd/mm/yyyy However, when that is written to MySql it is either not accepted or another value is tored in the database. Is there any way to change value of this field back to yyyymmdd format as accepted correctly in sql. ? The change should preferably be when user click on submit.
3
4416
by: murch.alexander | last post by:
I made a simple public function to set and return a date value (see below). I have a number of queries that call up the function to get the "As Of Date," which is typically set to today's date. Occasionally though, I need to change the "As Of Date" to some date in the past, and then when I run the queries, they're based on that date in the past. This generally works fine, but, sometimes, the date gets reset to something WAY in the past...
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9565
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10317
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7604
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5501
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
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

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.