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

Query criteria problem

I have a query which gets its criteria from a form. On the form is a combo
which selects cust number and a text box selecting date.
This works fine if both have data or both are null.
Is there a way to have 1 with data and 1 null. -- So I can see all the
customers with activity on 11th March or I can see all of Mr White`s activity on
any day

SQL follows

SELECT SundrySaletbl.eventDate, SundrySaletbl.customerid,
[Forms]![SundrySalefrm]![evdate] AS Expr1, [Forms]![sundrysalefrm]![selectcust]
AS Expr2
FROM SundrySaletbl
WHERE (((SundrySaletbl.eventDate)=[Forms]![SundrySalefrm]![evdate]) AND
((SundrySaletbl.customerid)=[Forms]![sundrysalefrm]![selectcust])) OR
((([Forms]![SundrySalefrm]![evdate]) Is Null) AND
(([Forms]![sundrysalefrm]![selectcust]) Is Null));

TIA
David B
Hexham UK

Nov 12 '05 #1
1 1302
"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c5**********@news6.svr.pol.co.uk...
I have a query which gets its criteria from a form. On the form is a combo which selects cust number and a text box selecting date.
This works fine if both have data or both are null.
Is there a way to have 1 with data and 1 null. -- So I can see all the
customers with activity on 11th March or I can see all of Mr White`s activity on any day


Something like this:
SELECT eventDate, customerid
FROM SundrySaletbl
WHERE
(
eventDate=[Forms]![SundrySalefrm]![evdate] OR
[Forms]![SundrySalefrm]![evdate] Is Null
)
AND
(
customerid=[Forms]![sundrysalefrm]![selectcust] OR
[Forms]![SundrySalefrm]![evdate] Is Null
)
Nov 12 '05 #2

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

Similar topics

1
by: Cory | last post by:
When I run the subroutine testEmailContacts the msgbox says that there is only 1 record. The sql for qyEmailContactsQyCard is below. There is over 3000 records in the table "tbl:Contact". What am i...
3
by: dskillingstad | last post by:
I'd appreciate any help I can get. I'm not sure what I'm doing wrong, but.... I've searched these groups for some solutions but no luck. I have an unbound form (frmSearch), with several unbound...
3
by: MLH | last post by:
Am repeating question with different subject heading, perhaps stating more clearly my problem... I have an A97 query (qryVehiclesNowners2) that has a table field in it named . Depending on the...
2
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and...
4
by: Stan | last post by:
I am using MS Office Access 2003 (11.5614). My basic question is can I run a query of a query datasheet. I want to use more that one criteria and can not get that query to work. I thought I...
6
by: Vince | last post by:
Hello all, I am using Visual Basic to open a saved query and then save information in the query to an array for later use. The problem is that the same query shows different results when opened...
6
by: jmarcrum | last post by:
Hi! I have created a Union Query in ACCESS 2003, that combines 130 records from one query (Extra Foreman Radios) and 250 records from another query (Forman Main Radios). I have created a...
17
by: sharsy | last post by:
Hello guys, I would like some help in generating query criteria that will identify credit cards that have expired on an access database. The specific Field is formatted with a Data Type of...
0
prabirchoudhury
by: prabirchoudhury | last post by:
CRITERIA; +-------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+-------+...
4
by: dizzydangler | last post by:
Hi all, I am a new Access user and just starting to get my head around some of the basic concepts, so please take it easy on me :) My company has been managing client records on excel, and I’m in...
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: 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: 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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.