Query

G

Guest

I have a query with many fields. But two inperticular I am working with.
[First Name] and [Cancelled]
Right now I have is null under [First Name] but if the field Cancelled has
the word cancelled ticket then I want that record to show. Can someone tell
me what I should right and under which field to put it?
Thanks.
Chey
 
G

Guest

Post the SQL of your query.
Open the query in design view, click on menu VIEW - SQL View. Highlight
all, copy, and paste in a post.
 
R

Rick B

On the same line in the query (this creates an AND operation) put =True
under the Cancelled field (I assume this is a Yes/No type field.)

This would return records where the name is null *and* the cancelled field
is checked.
 
M

Mike Labosh

I have a query with many fields. But two inperticular I am working with.
[First Name] and [Cancelled]
Right now I have is null under [First Name] but if the field Cancelled has
the word cancelled ticket then I want that record to show. Can someone
tell
me what I should right and under which field to put it?

Is this what you're looking for?

SELECT ...
FROM...
WHERE [First Name] IS NULL
AND Cancelled = 'cancelled ticket'

Alternately,

....
WHERE [First Name] IS NULL
AND Cancelled IS NOT NULL
--


Peace & happy computing,

Mike Labosh, MCSD MCT
Owner, vbSensei.Com

"Escriba coda ergo sum." -- vbSensei
 
G

Guest

Chey:

Put the value of the Cancelled field for which you want to show rows even if
First Name is Null on the second criteria line (labelled on the left as or:)
under the Cancelled column in the query design grid.

Ken Sheridan
Stafford, England
 
G

Guest

This is what I have where do I place the code you gave me?

SELECT [TA Numbers].[First and Last Name], [TA Numbers].[TA Last 3], [TA
Numbers].[TA Number], [TA Numbers].Employee, [TA Numbers].Orgin, [TA
Numbers].Destination, [TA Numbers].[I/O Travel], [TA Numbers].Puropose, [TA
Numbers].[Date Leave], [TA Numbers].[Date Return], [TA Numbers].[Advanced
Y/N], [TA Numbers].[Date Finalized], [TA Numbers].[Trip Cancelled], [TA
Numbers].[Personal Check], [TA Numbers].[$0 TA Y/N], [TA Numbers].[Today's
Date], [TA Numbers].[Travel Complete], [TA Numbers].[Sent to finace], [TA
Numbers].[Travel Approved], [TA Numbers].[Date Approved], [TA
Numbers].[Travel Not Approved], [TA Numbers].[Date Not Approved], [TA
Numbers].[Trip Cancelled Date], [TA Numbers].[Travel Cancelled]
FROM [TA Numbers]
WHERE ((([TA Numbers].[First and Last Name]) Is Null) AND (([TA Numbers].[TA
Number]) Between "06CA060001" And "06CA060099" Or ([TA Numbers].[TA Number])
Between "06CA060300" And "06CA060399"))
ORDER BY [TA Numbers].[TA Number];

Mike Labosh said:
I have a query with many fields. But two inperticular I am working with.
[First Name] and [Cancelled]
Right now I have is null under [First Name] but if the field Cancelled has
the word cancelled ticket then I want that record to show. Can someone
tell
me what I should right and under which field to put it?

Is this what you're looking for?

SELECT ...
FROM...
WHERE [First Name] IS NULL
AND Cancelled = 'cancelled ticket'

Alternately,

....
WHERE [First Name] IS NULL
AND Cancelled IS NOT NULL
--


Peace & happy computing,

Mike Labosh, MCSD MCT
Owner, vbSensei.Com

"Escriba coda ergo sum." -- vbSensei
 
G

Guest

What is your primary Key field in your table containing the (First Name)

Is [First Name] and [cancelled] in the same table?

Please provide information on the "many fields" and their relationships
 
G

Guest

SELECT [TA Numbers].[First and Last Name], [TA Numbers].[TA Last 3], [TA
Numbers].[TA Number], [TA Numbers].Employee, [TA Numbers].Orgin, [TA
Numbers].Destination, [TA Numbers].[I/O Travel], [TA Numbers].Puropose, [TA
Numbers].[Date Leave], [TA Numbers].[Date Return], [TA Numbers].[Advanced
Y/N], [TA Numbers].[Date Finalized], [TA Numbers].[Trip Cancelled], [TA
Numbers].[Personal Check], [TA Numbers].[$0 TA Y/N], [TA Numbers].[Today's
Date], [TA Numbers].[Travel Complete], [TA Numbers].[Sent to finace], [TA
Numbers].[Travel Approved], [TA Numbers].[Date Approved], [TA
Numbers].[Travel Not Approved], [TA Numbers].[Date Not Approved], [TA
Numbers].[Trip Cancelled Date], [TA Numbers].[Travel Cancelled]
FROM [TA Numbers]
WHERE ((([TA Numbers].[First and Last Name]) Is Null) AND (([TA Numbers].[TA
Number]) Between "06CA060001" And "06CA060099" Or ([TA Numbers].[TA Number])
Between "06CA060300" And "06CA060399"))
ORDER BY [TA Numbers].[TA Number];

Thanks
Chey

KARL DEWEY said:
Post the SQL of your query.
Open the query in design view, click on menu VIEW - SQL View. Highlight
all, copy, and paste in a post.

Chey said:
I have a query with many fields. But two inperticular I am working with.
[First Name] and [Cancelled]
Right now I have is null under [First Name] but if the field Cancelled has
the word cancelled ticket then I want that record to show. Can someone tell
me what I should right and under which field to put it?
Thanks.
Chey
 
G

Guest

It is not a check box. It is drop down with Cancelled or Ticket used.
If it says Cancelled and [First name] is null I want to show.
Thanks a bunch.
Chey

Rick B said:
On the same line in the query (this creates an AND operation) put =True
under the Cancelled field (I assume this is a Yes/No type field.)

This would return records where the name is null *and* the cancelled field
is checked.


--
Rick B



Chey said:
I have a query with many fields. But two inperticular I am working with.
[First Name] and [Cancelled]
Right now I have is null under [First Name] but if the field Cancelled has
the word cancelled ticket then I want that record to show. Can someone
tell
me what I should right and under which field to put it?
Thanks.
Chey
 
G

Guest

Got it to work thanks


Ken Sheridan said:
Chey:

Put the value of the Cancelled field for which you want to show rows even if
First Name is Null on the second criteria line (labelled on the left as or:)
under the Cancelled column in the query design grid.

Ken Sheridan
Stafford, England

Chey said:
I have a query with many fields. But two inperticular I am working with.
[First Name] and [Cancelled]
Right now I have is null under [First Name] but if the field Cancelled has
the word cancelled ticket then I want that record to show. Can someone tell
me what I should right and under which field to put it?
Thanks.
Chey
 
M

Mike Labosh

Right here:

WHERE ((([TA Numbers].[First and Last Name]) Is Null) AND (([TA Numbers].[TA
Number]) Between "06CA060001" And "06CA060099" Or ([TA Numbers].[TA Number])
Between "06CA060300" And "06CA060399"))

AND [First Name] IS NULL
AND Cancelled = 'cancelled ticket'

--


Peace & happy computing,

Mike Labosh, MCSD MCT
Owner, vbSensei.Com

"Escriba coda ergo sum." -- vbSensei
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top