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

date based criteria

got another one for you guys out there, and thanks again for the help
with my "counting question"

this time i'm looking to select records based on date, the database
stores the date as mm/dd/yyyy time am/pm ie: 08/11/2004 2:42:28 PM and
unfortunately the field is called date

this much I know if i want to select based on date:

select from table where [date]=

it's my understanding that i need to put the name of the date field in
[] in order to prevent it from confusing it with functions etc...
however my problem is this

how do i get it to select records from the month of december i have
tried [date]='12/*/2004' and [date]='::12/*/2004::' and many other
variants that i have read about on various web sites, but it never seems
to work once again the answer is probably not as complicated as i
believe it to be, but i just can't seem to find the right answers when i
hit the search engines, so if someone can explain how this should be
done, that would be greatly appreciated

thanks
Jul 22 '05 #1
3 1409
C White wrote:
got another one for you guys out there, and thanks again for the help
with my "counting question"

this time i'm looking to select records based on date, the database
What database? It's always relevant. Type and version.
stores the date as mm/dd/yyyy time am/pm ie: 08/11/2004 2:42:28 PM and
Unless the field is a character field, the datetime is NOT stored like that.
it may be displayed like that, but it is not stored that way. The details of
how it is stored depends on the database.
unfortunately the field is called date
Yes, that is bad.

this much I know if i want to select based on date:

select from table where [date]=

it's my understanding that i need to put the name of the date field in
[] in order to prevent it from confusing it with functions etc...
Correct, unless you can change the name of the field. More reserved keywords
can be found here:
http://www.aspfaq.com/show.asp?id=2080
however my problem is this

how do i get it to select records from the month of december i have
tried [date]='12/*/2004' and [date]='::12/*/2004::' and many other
variants that i have read about on various web sites, but it never
seems to work once again the answer is probably not as complicated as
i believe it to be, but i just can't seem to find the right answers
when i hit the search engines, so if someone can explain how this
should be done, that would be greatly appreciated

Again, it depends on the database, but basically you want to do something
like:

where [date] >= Dec.1 and [date] <= Dec 31

Now the dates will not look like that. I can't tell you how to specify the
dates until you tell us what database you are using. In the meantime, read
up on dates here:

http://www.aspfaq.com/show.asp?id=2313 vbscript
http://www.aspfaq.com/show.asp?id=2040 help with dates
http://www.aspfaq.com/show.asp?id=2260 dd/mm/yyy confusion

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2
Bob Barrows [MVP] wrote:
C White wrote:
got another one for you guys out there, and thanks again for the help
with my "counting question"

this time i'm looking to select records based on date, the database

What database? It's always relevant. Type and version.

stores the date as mm/dd/yyyy time am/pm ie: 08/11/2004 2:42:28 PM and

Unless the field is a character field, the datetime is NOT stored like that.
it may be displayed like that, but it is not stored that way. The details of
how it is stored depends on the database.

unfortunately the field is called date

Yes, that is bad.

this much I know if i want to select based on date:

select from table where [date]=

it's my understanding that i need to put the name of the date field in
[] in order to prevent it from confusing it with functions etc...

Correct, unless you can change the name of the field. More reserved keywords
can be found here:
http://www.aspfaq.com/show.asp?id=2080

however my problem is this

how do i get it to select records from the month of december i have
tried [date]='12/*/2004' and [date]='::12/*/2004::' and many other
variants that i have read about on various web sites, but it never
seems to work once again the answer is probably not as complicated as
i believe it to be, but i just can't seem to find the right answers
when i hit the search engines, so if someone can explain how this
should be done, that would be greatly appreciated


Again, it depends on the database, but basically you want to do something
like:

where [date] >= Dec.1 and [date] <= Dec 31

Now the dates will not look like that. I can't tell you how to specify the
dates until you tell us what database you are using. In the meantime, read
up on dates here:

http://www.aspfaq.com/show.asp?id=2313 vbscript
http://www.aspfaq.com/show.asp?id=2040 help with dates
http://www.aspfaq.com/show.asp?id=2260 dd/mm/yyy confusion

Bob Barrows

it's an access 2000 database, unfortunately i can't get them to change
the name of the field

many thanks for the links at first glance they appear to be what i am
looking for
Jul 22 '05 #3
Bob Barrows [MVP] wrote:
C White wrote:
got another one for you guys out there, and thanks again for the help
with my "counting question"

this time i'm looking to select records based on date, the database

What database? It's always relevant. Type and version.

stores the date as mm/dd/yyyy time am/pm ie: 08/11/2004 2:42:28 PM and

Unless the field is a character field, the datetime is NOT stored like that.
it may be displayed like that, but it is not stored that way. The details of
how it is stored depends on the database.

unfortunately the field is called date

Yes, that is bad.

this much I know if i want to select based on date:

select from table where [date]=

it's my understanding that i need to put the name of the date field in
[] in order to prevent it from confusing it with functions etc...

Correct, unless you can change the name of the field. More reserved keywords
can be found here:
http://www.aspfaq.com/show.asp?id=2080

however my problem is this

how do i get it to select records from the month of december i have
tried [date]='12/*/2004' and [date]='::12/*/2004::' and many other
variants that i have read about on various web sites, but it never
seems to work once again the answer is probably not as complicated as
i believe it to be, but i just can't seem to find the right answers
when i hit the search engines, so if someone can explain how this
should be done, that would be greatly appreciated


Again, it depends on the database, but basically you want to do something
like:

where [date] >= Dec.1 and [date] <= Dec 31

Now the dates will not look like that. I can't tell you how to specify the
dates until you tell us what database you are using. In the meantime, read
up on dates here:

http://www.aspfaq.com/show.asp?id=2313 vbscript
http://www.aspfaq.com/show.asp?id=2040 help with dates
http://www.aspfaq.com/show.asp?id=2260 dd/mm/yyy confusion

Bob Barrows

between your example and the links I managed to figure it out:

([Date] >= #12/1/2004# and [Date] <=#12/31/2004#)

gives me everything for december

thanks again, once again it wasn't as hard as i was making it out to be,
once someone who knew what they were doing pointed me in the right direction
Jul 22 '05 #4

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

Similar topics

12
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date...
3
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
3
by: bcaponet | last post by:
I have a form where a user enters a date that I will then base a query on. In the past, I have simply placed Forms!! into the criteria for a query and it runs as long as the form is open. The...
1
by: Rinee | last post by:
Hi, I have a database of a bunch of contractors who have signed a safety agreement with us, their contact info, their insurance info, etc. Each was assigned an ID number as the main key. Each...
2
by: dympna | last post by:
Hi can anyone suggest a fix for this... as I am a novice in access. I have created a training table with the following fields Employee Name - joe Training Received - Fork lift Date Received...
3
by: Scotter | last post by:
Hi, I've been trying to make a report that will show the deliverys to be made between 2 dates, or the deliverys to be made after a certian date, or the deliveries that were made before a certian...
8
by: Dr Al | last post by:
I have a table with four date fields, some of which may not be filled in based on our data entry needs. I have a criteria set as <date()-180 which is supposed to pull dates older than 180 days ago....
0
by: =?Utf-8?B?QnJ5YW4=?= | last post by:
Hello group. I've migrated from Win 2003 server to Win 2008 server. I've been banging my head agaist a wall for several days now trying to figure this out. I have the following script that will...
2
by: kashif73 | last post by:
Hi, I want to export data from 4 Access tables to Excel using VBA. The user selects 2 different DATES from the form & based on DATEs criteria all record from 4 tables should be extracted to...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.