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

Trying to run SQL Date query

6
Hi There,

I am a newby with SQL and I am trying to run a query on a date/time field. The query is for the previous date. I would like to create this as a criteria in a view, but not sure what the criteria should look like doing a previous day query.

The test query I have done using SQL analyzer is (select * from mvs_store_all_data_time_change where mvs_creation_date like '060801%').

This returns the previous days data, but is hard coded and need the query to be used daily, for the previous date.

Any can help? :).
Aug 2 '06 #1
1 2737
Not sure about which database you are using, but in DB2 I would execute something like:

SELECT * FROM table WHERE creation_date = (CURRENT DATE - 1 DAY);
Aug 4 '06 #2

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

Similar topics

6
by: James Turner | last post by:
I am trying to store formatted text (windows format) into a MySQL database and then retrieve it. The field in the database is a varchar. I cut and paste the test into a form field formatted, then...
2
by: BlackFireNova | last post by:
I have an Access 2003 mdb which contains software records. I need to sort on a particular type of software, and then identify and count how many copies there are per each group of that type...
10
by: Kenneth | last post by:
I have a Query that consist of a lot of different sales data, and one of the colums are different date. The date goes from 1jan2003 til 31jan2003. in this Query I only want the salesdata for...
7
by: Nicolae Fieraru | last post by:
Hi All, I have a table tblProducts where I have four fields:\ Index, ProductName, EnterDate (as Date/Time - Medium Date), PurchaseDate (Date/Time - Medium Date) The EnterDate is automatically...
6
by: syvman | last post by:
Hi all... I have a quick question, if anyone knows the answer. I've built a query which looks at a set of records in a table (tblFilename) and I've set it up so that it displays the following...
5
by: DeanL | last post by:
Hi all, I'm trying to set up a query that runs from a command button on a form (simple enough so far), what I want the query to do is take values from the fields on the form (seven fields in...
2
by: snk | last post by:
hello, Iam new in MySQL, in fact its my first day but i have stacked for several hours. I have 3 subqueries, i can mix the 2 of them but i get an error for the third one the first one is ...
8
by: Trevor2007 | last post by:
I am trying to hard code the following select query into a select case statement ie (case1 <statment>, case 2 <statment>) but I getteing Compiler error: expected line number or label, or...
12
by: denveromlp | last post by:
Hello, I'm new to Access and trying to calculate a rolling 12 month average from some time data. Each data point is a date and a measurement taken at that date. As far as I can tell, the only...
3
by: Anthony97 | last post by:
I'm trying to get a date that's is 7 days earlier than the current date, so when I run the query I will always have records that came in within the last week. Here's the section of the code I'm...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.