Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 16th, 2008, 07:54 AM
Friend of Wrox
 
Join Date: Apr 2007
Location: , , .
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));


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:04 AM.


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