Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 11th, 2004, 07:34 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query syntax problem

I use following query in the Access Report.
but is not working, it not display the record where airline='BA' etc.
there is problem in where cluase airline.
when query run it ask the start date and end date and airline,
I have to give airline ie BA, it should display record
which airline is BA, but is display all records.

Please check the syntax of where clause to use following query in Access Report ?

SELECT [customer].[salesdate], [customer].[pname], [customer].[refco], [customer].[airline], [customer].[travfr], [customer].[travto], [customer].[outamt], [customer].[tcollect], [tcollect]-[outamt] AS Expr1
FROM customer
WHERE [customer].[salesdate] Between [ Start Date (m/d/y) ] And [End Date (m/d/y) ] And customer.airline='#customer.airline#';

regards.

Mateen



 
Old October 11th, 2004, 09:16 AM
Authorized User
 
Join Date: Jul 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this

SELECT [customer].[salesdate], [customer].[pname], [customer].[refco], [customer].[airline], [customer].[travfr], [customer].[travto], [customer].[outamt], [customer].[tcollect], [tcollect]-[outamt] AS Expr1
FROM customer
WHERE [customer].[salesdate] Between [ Start Date (m/d/y) ] And [End Date (m/d/y) ] And customer.airline=[input_airline];

I think the #'s were throwing it off possibly, as well as setting the variable to the same name as the field, customer.airline=customer.airline will always evaluate as true.



 
Old October 12th, 2004, 11:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Query Syntax [email protected] SQL Language 1 May 1st, 2007 06:42 AM
Syntax Query digby_dog SQL Server 2000 2 September 8th, 2005 08:37 AM
MySQL syntax in query Tachyon Beginning PHP 1 June 26th, 2004 08:42 PM
Syntax error in query. Incomplete query clause. dispickle ADO.NET 3 April 16th, 2004 01:04 PM
QUERY SYNTAX singh_ginni Oracle 1 September 10th, 2003 07:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.