473,379 Members | 1,222 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.

I'M LOST.... AGAIN....

Hello... Once again, I'm stuck doing something I KNOW I've done
before, but I simply can't make it work this time in my query:

FIELD A is "date tested"
FIELD B is "number of months until next test" i.e., 12, 24, 72
EXPR1 is a dateadd (A+B = "Date test due")

I need my query to only display records where EXPR1 is a date that is
within the next 12 months. Some of these tests aren't due for 13
months or more, and I just need to have a report that shows "Date test
due" that are in the next 12 months (from "date())
Thanks in advance.

V/r
Scott

Nov 13 '05 #1
5 1171
Put the following expression in a blank field in your query:
DateTestDue:DateAdd("m",[Field B],[Field A])

Put the following expression in the criteria of that field:
<= DateAdd("m",12,Date())

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
<sc*********@japan.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hello... Once again, I'm stuck doing something I KNOW I've done
before, but I simply can't make it work this time in my query:

FIELD A is "date tested"
FIELD B is "number of months until next test" i.e., 12, 24, 72
EXPR1 is a dateadd (A+B = "Date test due")

I need my query to only display records where EXPR1 is a date that is
within the next 12 months. Some of these tests aren't due for 13
months or more, and I just need to have a report that shows "Date test
due" that are in the next 12 months (from "date())
Thanks in advance.

V/r
Scott

Nov 13 '05 #2
Br
sc*********@japan.com wrote:
Hello... Once again, I'm stuck doing something I KNOW I've done
before, but I simply can't make it work this time in my query:

FIELD A is "date tested"
FIELD B is "number of months until next test" i.e., 12, 24, 72
EXPR1 is a dateadd (A+B = "Date test due")

I need my query to only display records where EXPR1 is a date that is
within the next 12 months. Some of these tests aren't due for 13
months or more, and I just need to have a report that shows "Date test
due" that are in the next 12 months (from "date())
Thanks in advance.

V/r
Scott

SELECT *
FROM tblMyTable
WHERE DateDiff("m", DateAdd("m", [Date Tested], [MonthsUntilTest]),
Date())
BETWEEN 0 and 12

??

Not sure that will work.. but it should give you something to start on
:) There's probably a better approach too.

Br@dley
Nov 13 '05 #3
I end up with a "Data type mismatch in criteria expression".

Nov 13 '05 #4
Br
Loki wrote:
I end up with a "Data type mismatch in criteria expression".


Which means your trying to compare a value of one type with a value of
another incompatible type.

Br@dley


Nov 13 '05 #5
Check your table that contains Field B. Field B needs to be a Number
(Integer) data type not text.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Loki" <sc*********@japan.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I end up with a "Data type mismatch in criteria expression".

Nov 13 '05 #6

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

Similar topics

383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
20
by: John Bailo | last post by:
http://www.joelonsoftware.com/articles/APIWar.html "So you've got the Windows API, you've got VB, and now you've got .NET, in several language flavors, and don't get too attached to any of...
1
by: Eliyahu Goldin | last post by:
When I run my ASP.NET application first time after deployment, it runs OK. On the second run, when one of my web forms tries to read session variables set in another form, it finds them empty....
6
by: Paul H | last post by:
Hi I have a problem with certain users of my ASP.NET application. The user logs into the site, and they are logged into the application. Then when they select a link, they are presented with a...
3
by: Alex | last post by:
Hello. Maybe someone can help me. My development computer has: WindowsXP SP2 and MSSQL Server 2000 and IIS 5.0(or 5.1) Our webserver has: Windows2003 SP1 and MSSQL Server 2005 and IIS 6.0 We are...
2
by: maxkumar | last post by:
Hi, I am running a ASP.NET 1.1 site on Win Server 2003 with IIS 6.0. The website has been running for about 1.5 years now. In the past, we used to have random cases of session variables getting...
45
by: Master Programmer | last post by:
- Constant language / system changes - Dropping of the VB language - Security configuation minefields - Loss of old code base - Time consuming to learn (then it changes every 5 minutes) - Slow...
0
by: Corinne | last post by:
Hi All, I have created a form. with radiobuttonlist. On submit the form calls itself as it reloads I want the radiobuttonlist to be displayed but i don't want anyone to be able to change the...
10
by: sam.barker0 | last post by:
Hi there, I am trying to develop a compressed suffix trie. But first I want to get the trie working. The structure of the trie is like class trie { private: bool last_node; map<char,...
1
by: =?Utf-8?B?bW5vd29zYWQ=?= | last post by:
We have an ASP.NET 2.0 web site, running on IIS version 6.0, Windows 2003 server. On the Application_Start event of the Global.asax.cs, we load configuration values to the HttpApplicationState...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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.