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

compare date field to current date

Need some hwlp with comparing a date field retrieved from an access
date base to the current date. Basically I'm looking to create and if
statement like:
If strArticleDate < = Current Date then
else...

Thanks for any help or feedback
Mike
Jul 19 '05 #1
4 16175
Try using DateDiff

if DateDiff("d",strArticleDate, CurrentDate)>0 then
'whatever
"Michael Haas" <mh***@mail.lr.k12.nj.us> wrote in message
news:16**************************@posting.google.c om...
Need some hwlp with comparing a date field retrieved from an access
date base to the current date. Basically I'm looking to create and if
statement like:
If strArticleDate < = Current Date then
else...

Thanks for any help or feedback
Mike

Jul 19 '05 #2

I'm having a problem witht he currentdate part:
if I substitute "02/15/2004" for CurrentDate it works
Do I need to format CurrentDate? how should I decalre it?
Thanks for the help again.
Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
You shouldn't have to worry about formatting.

WHERE dateColumn <= Date()

or better yet, if dateColumn has time information,

WHERE dateColumn < DATEADD("d", 1, Date())

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Mike Haas" <mh***@mail.lr.k12.nj.us> wrote in message
news:u8**************@TK2MSFTNGP12.phx.gbl...

I'm having a problem witht he currentdate part:
if I substitute "02/15/2004" for CurrentDate it works
Do I need to format CurrentDate? how should I decalre it?
Thanks for the help again.
Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4

That did the trick, thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5

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

Similar topics

4
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...
2
by: AdityaK | last post by:
Is there anyway I can get weekend date for a given date using DB2 query? I couldn't find any DB2 function that can be used to do so. Thanks, Aditya
1
by: ToysNTreasures | last post by:
Hi, I'm working on a class project in which I have to create a simple hotel reservation database using Access. I've created a couple of tables and queries that allow a user to determine room...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
1
by: CZ | last post by:
Hello, I have a list of employees with their birhtdays. I would like to to have a datagrid list employees with birthdays on the current month on a web page. I tried select * from tbldate...
5
by: bruce24444 | last post by:
I have a database which assigns warranty claims to people with a main screen showing number of files assigned to each person. The number assigned shows day, week, month and year numbers so they can...
6
vikas1111
by: vikas1111 | last post by:
How to set date to current date...it should automatically update..
2
by: Ben Clay | last post by:
I am a novice developer working in Vb.NET to develop a web application that can compare the current date to a date in another field, calculate the difference in days, and perform a function on that...
2
Soniad
by: Soniad | last post by:
Hi, In my website, I show commodity details on daily basis.These details are stored in one table for each day. I select record by matching current date and current date records are...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: 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...

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.