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

Working with dates...

I'm using ASP to access an MS Access database. One issue that I'm constantly
having problems with is Date/Time records.

What I'd like to know is how does one work with date variables in ASP?

My current problem is this...

I have two variables, Mnth and Yr, which each hold an integer. Mnth holds
between 1 and 12 ( a month ), and Yr holds the desired year (2005 for
example).

With only these two variables how can I generate a full date to use in an
SQL query, such as:

SELECT * From Table WHERE DateAdded>??<date value here>??

Jul 22 '05 #1
5 1290
"Noozer" <do*******@me.here> wrote in message
news:LI7xe.137500$El.57669@pd7tw1no...
I'm using ASP to access an MS Access database. One issue that I'm
constantly
having problems with is Date/Time records.

What I'd like to know is how does one work with date variables in ASP?

My current problem is this...

I have two variables, Mnth and Yr, which each hold an integer. Mnth holds
between 1 and 12 ( a month ), and Yr holds the desired year (2005 for
example).

With only these two variables how can I generate a full date to use in an
SQL query, such as:

SELECT * From Table WHERE DateAdded>??<date value here>??

Use a column type of datetime instead.
--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
Jul 22 '05 #2

"John Blessing" <jb@**REMOVE**THIS**Lbesoftware.com> wrote in message
news:s2*******************@newsfe2-gui.ntli.net...
"Noozer" <do*******@me.here> wrote in message
news:LI7xe.137500$El.57669@pd7tw1no...
I'm using ASP to access an MS Access database. One issue that I'm
constantly
having problems with is Date/Time records.

What I'd like to know is how does one work with date variables in ASP?

My current problem is this...

I have two variables, Mnth and Yr, which each hold an integer. Mnth holds between 1 and 12 ( a month ), and Yr holds the desired year (2005 for
example).

With only these two variables how can I generate a full date to use in an SQL query, such as:

SELECT * From Table WHERE DateAdded>??<date value here>??

Use a column type of datetime instead.


The column already is a DateTime... My problem is that my code only has a
month and year stored in variables. How do I convert that to a date to make
a valid comparison against the DateTime column?
Jul 22 '05 #3
Noozer wrote:
I'm using ASP to access an MS Access database. One issue that I'm
constantly having problems with is Date/Time records.

What I'd like to know is how does one work with date variables in ASP?

My current problem is this...

I have two variables, Mnth and Yr, which each hold an integer. Mnth
holds between 1 and 12 ( a month ), and Yr holds the desired year
(2005 for example).

With only these two variables how can I generate a full date to use
in an SQL query, such as:

SELECT * From Table WHERE DateAdded>??<date value here>??


Read these and come back if you have further questions on the topic:
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 #4

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Noozer wrote:
I'm using ASP to access an MS Access database. One issue that I'm
constantly having problems with is Date/Time records.
Read these and come back if you have further questions on the topic:
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


Very, very helpful stuff. Thanks!!!
Jul 22 '05 #5
"Noozer" <do*******@me.here> wrote in message
news:LI7xe.137500$El.57669@pd7tw1no...
I have two variables, Mnth and Yr, which each hold an integer.
Mnth holds between 1 and 12 ( a month ), and Yr holds the desired
year (2005 for example).

With only these two variables how can I generate a full date to use in an
SQL query, such as:


sSQL = "SELECT col1, col2, col3, ... " _
& "FROM Table1 " _
& "WHERE DateAdded >= #" _
& "#" & Right( "000" & Yr, 4 ) _
& "-" & Right( "0" & Mnth, 2 ) _
& "-" & "01" & "# "

HTH,
Phill W.
Jul 22 '05 #6

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

Similar topics

2
by: Mad | last post by:
Hello to all. I have been trying to work with dates on Visual Basic Version 3. Using a Textbox (Text1.text) I understand that "Format" is use to display the date as you like. But what type...
2
by: wireless200 | last post by:
I've got a table with some datetime fields in it. One field (call it field 1) is of the form mm/dd/yyyy and the other two (fields 2 and 3) are in the form of hh:mm:ss:xx where xx is hundreths of...
5
by: tshad | last post by:
I have a date validation function that I want to stay at the object I am validating if there is a Validation error, but it always goes to the next object. The Javascript: function...
5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
3
by: | last post by:
Hello, I am hoping someone else has thought about a date time calculation i need to perform. I would like to be able to calculate the number of "working minutes" between 2 dates, given my...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
12
by: jonathan184 | last post by:
Hi the purpose of the script I am trying to do is to access a dir and run the ls -l command which will show the files and the modified date, no w the script is to check two files in that dir , if the...
11
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
6
by: Mike Copeland | last post by:
I am working with a file of data that contains "time values" (e.g. "1225365563"), and I want to convert this data into something I can use in a program I'm developing. From what I've read about...
2
by: angi35 | last post by:
Hi, I'm working in Access 2000. I have a form with a series of date fields, showing the progress of a project from start to completion. There's a set of fields/controls for projected dates (when...
1
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: 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...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.