473,326 Members | 2,013 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,326 software developers and data experts.

Query database for today and yesterday...

22
I'm trying to construct a report based on a database query that retrieves the records from the current day as well as the day before. Can anyone explain the proper syntax for doing this? I tried using the DateDiff function but couldn't seem to get it working at all. Any help would be appreciated... thanks...
Nov 1 '06 #1
4 14364
NeoPa
32,556 Expert Mod 16PB
Syntax
DateAdd(interval, number, date)
Try :-
Expand|Select|Wrap|Line Numbers
  1. ...
  2. "WHERE ([YourFieldName]>" & Format(DateAdd("d", -2, Date()), "\#m/d/yyyy\#") & ")"
Nov 1 '06 #2
MMcCarthy
14,534 Expert Mod 8TB
I'm trying to construct a report based on a database query that retrieves the records from the current day as well as the day before. Can anyone explain the proper syntax for doing this? I tried using the DateDiff function but couldn't seem to get it working at all. Any help would be appreciated... thanks...
[code]

WHERE DateField=Date() OR DateField=Date()-1;
Nov 1 '06 #3
Luongo
22
Thanks, was trying to complicate it I guess. Didn't realize it was that simple...
Nov 2 '06 #4
MMcCarthy
14,534 Expert Mod 8TB
Thanks, was trying to complicate it I guess. Didn't realize it was that simple...
Not a problem.

We all suffer from the "overcomplicating it" syndrome.
Nov 7 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
1
by: Phantom_guitarist | last post by:
I am trying to write a query (in PHP) which selects from a database all of the items which are in the future. My query is as follows SELECT * FROM news WHERE ((news.date)>$today ORDER BY date ...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
2
by: Dan | last post by:
Hi all! I am creating a Disney "Today in History" database, and so far have about 300 entries in it. Well, my Access database is great, and my Frontpage form is great, but I want to include a...
1
by: John | last post by:
Hi I have a table of job ids and dates. What query will get me the job id of the earliest job after yesterday i.e. a job that is either today, or if there is no job today, a job that is as soon...
2
by: Zygo Blaxell | last post by:
I have a table with a few million rows of temperature data keyed by timestamp. I want to group these rows by timestamp intervals (e.g. every 32 seconds), compute aggregate functions on the...
0
seshu
by: seshu | last post by:
Hi Every Body This is seshu,today i saw an option in mysqi database in tools menu and the option is export result set when i click on that it is asking me to...
16
by: Sam Durai | last post by:
Hello, I need to merge a small table (of rows less than 100,sometimes even 0 rows) to a big table (of rows around 4 billion). I used the PK of the big table as merge key but merge does a table scan...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.