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

Retrieve records from 30 Days Prior

102 64KB
Hello Friends
I am making a query to retrieve Data 30 days before from Current Date. Here is the query but it is not working.

Expand|Select|Wrap|Line Numbers
  1. SELECT DM.ClassName, DM.SizeName, DM.TDate, DM.FAS, DM.FM
  2. FROM DM
  3. WHERE (((DM.TDate)=Date()-30))
  4. ORDER BY DM.ClassName, DM.TDate;
can any one help me plz.
thanks
irsmalik
Dec 31 '18 #1
2 2116
twinnyfo
3,653 Expert Mod 2GB
Irsmalik,

I’ve moved your post to a new thread, as it really should be a new discussion.

Based upon your query, it should work. However, I noticed that you are sorting your results by the TDate, which implies that you have multiple dates in your results. However, if you do not have any ClassName that fall on exactly TDate - 30, then you will get no results.

Perhaps your Criteria expression should be:

Expand|Select|Wrap|Line Numbers
  1. WHERE DM.TDate >= Date()-30
This would return all records from within the past 30 days.

However, you do not describe how your query “is not working” so this is just a guess.

Hope this hepps.
Dec 31 '18 #2
NeoPa
32,556 Expert Mod 16PB
I agree with Twinny. Do you really mean you want those records from one particular day only? That day being thirty days before the current date?

If not then you need to clarify your thinking before designing your code. <= or >= can be used depending on what it is you actually want.

Further, please never just post that something isn't working. If you don't tell us what the problem is then how are we supposed to help you? Tell us what does happen and what is different from what you expect to happen. If an error is displayed then share that with us.

We like to help but you make that more difficult than it needs to be by withholding information that it is obvious we will need. After ten years why are we still at this very basic stage? What is stopping you from learning the most basic concepts of asking questions properly? It's not for lack of being told many, many times before.

I know English isn't your first language, but these problems are nothing to do with translation. They are missing information you've been told time and again is necessary in order for others to help you.
Jan 2 '19 #3

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

Similar topics

5
by: Rich Protzel | last post by:
Hello, If I run an action SP from MS Access using ADO: ... cmd.execute where the SP is something like Create... Update tbl1 set fld1 = 'something' where... how can I retrive the count of...
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
0
by: padhuwork | last post by:
Hi, I want to create a Windows DLL using VC++ 6.0 which connects to SQL Server. After establishing the connection, I want to retrieve records from table (query) and out put the recordset to a...
14
by: David | last post by:
Hi, I have a form on which a user can select a checkbox against a record. Each checkbox carries the RecordID of a product. ---------------------------------------------------------------- I...
4
by: Evanescent | last post by:
Hi Guys, I am trying to create a form which allows the users to retrieve records based on the values entered or chosen in the various combo boxes and textboxes, such as the customer's name, invoice...
2
by: JohanKotze | last post by:
I design a report that will show all the records for a particular client and all the records do show in the report BUT when I try to search between dates than only half of the records are showing...
7
by: MrDeej | last post by:
Hello my good people! It have come to my mind that stored procedures can help us speed up the retrival of records from our SQL server. I have now made a stored procedure at our server which is...
1
by: nikhil patil | last post by:
Hello All, I need to build another query using the same data. However, I have no idea how to reference the records from the previous recordset. I have put the code below, if you can...
2
by: luvkush | last post by:
i want to retrieve the records selected between from_dt and to_dt and also the records of the selected date should be retrieved... SELECT ChallanDtl.chalID, ChallanDtl.chalTo, ...
1
by: Corwin Moyne | last post by:
If I write: SELECT * FROM table_name WHERE date BETWEEN "2014/07/01" AND "2014/07/04" I get 4 records returned which is what I want. But I also want the total number of records which in this...
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
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.