Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 May 16th, 2008, 07:54 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default Access and SQL query Issue

Hi All
My Access applcation crash when running this query from Access Query Desinger but work fine in SQL


SQL ---- return 15 rows

SELECT Orders.MID, Orders.TotalValue, Sum(OBook.Value) AS SumOfValue,
min(Orders.CID) AS FirstOfCID,
min(Orders.Customer) AS FirstOfCustomer,
min(Orders.Date) AS FirstOfDate,
Orders.PostToBook, Customers.Rep, Customers.InternalRep,
Count(CountOfProInvoices.CountOfKeyNum) AS CountOfCountOfKeyNum

FROM ((Orders LEFT JOIN OBook ON Orders.MID = OBook.MID)

INNER JOIN Customers ON Orders.CID = Customers.CID)
LEFT JOIN CountOfProInvoices ON Orders.MID = CountOfProInvoices.MID

GROUP BY Orders.MID, Orders.TotalValue, Orders.PostToBook, Customers.Rep, Customers.InternalRep

HAVING (((Sum(OBook.Value))>[TotalValue]+0.01 Or (Sum(OBook.Value))<[TotalValue]-0.01)
AND ((min(Orders.Date))>='16-Apr-2008 ')
AND ((Orders.PostToBook)=1)) OR (((Orders.TotalValue)<>0)
AND ((Sum(OBook.Value)) Is Null) AND ((min(Orders.Date))>=' 16-Apr-2008 ') AND ((Orders.PostToBook)=1))


Access--- This query Hang and no response ultimatly need to shut down access query designer.

SELECT Orders.MID, Orders.TotalValue, Sum(OBook.Value) AS SumOfValue, First(Orders.CID) AS FirstOfCID, First(Orders.Customer) AS FirstOfCustomer, First(Orders.Date) AS FirstOfDate, Orders.PostToBook, Customers.Rep, Customers.InternalRep, Count(CountOfProInvoices.CountOfKeyNum) AS CountOfCountOfKeyNum
FROM ((Orders LEFT JOIN OBook ON Orders.MID = OBook.MID)

INNER JOIN Customers ON Orders.CID = Customers.CID) LEFT JOIN CountOfProInvoices ON Orders.MID = CountOfProInvoices.MID

GROUP BY Orders.MID, Orders.TotalValue, Orders.PostToBook, Customers.Rep, Customers.InternalRep

HAVING (((Sum(OBook.Value))>[TotalValue]+0.01 Or (Sum(OBook.Value))<[TotalValue]-0.01)
AND ((First(Orders.Date))>=#4/16/2008#)
AND ((Orders.PostToBook)=True)) OR (((Orders.TotalValue)<>0)
AND ((Sum(OBook.Value)) Is Null) AND ((First(Orders.Date))>=#4/16/2008#) AND ((Orders.PostToBook)=True));







Similar Threads
Thread Thread Starter Forum Replies Last Post
Usizing issue Access to SQL Server gvcooper Pro VB 6 0 April 30th, 2006 05:09 AM
SQL query question in Access dlamarche Access 3 April 3rd, 2005 10:42 PM
SQL Access/ASP.NET data access issue saeta57 SQL Server ASP 1 July 4th, 2004 04:29 PM
SQL Access/ASP.NET data access issue saeta57 Classic ASP Databases 1 July 4th, 2004 03:32 PM
Access VBA Delete Query Issue... snoopy92211 Access VBA 4 June 24th, 2004 03:57 PM





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