LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default MS Query - Use of Max?

Hi,

I have the following query which worked fine until we introduced
versioning on records. Now if there is a second version the record
will appear twice.

What I'd like to be able to do is include the intVersionID field and
if a record has, e.g. 2 versions, only bring out the largest number of
the record. In access formally I believe I could do this using Max,
however not sure how to use this when it's going via MS Query. The
data is then returned to excel, hence the posting in the Excel group -
however will repost if there's a more appropriate group to post in?

Thanks, Al.

SELECT vwDataProblems.intProblemLogNo AS 'PL #',
vwDataProblems.intChangeLogNo AS 'CCL #', vwDataProblems.strStatus AS
'Status', vwDataProblems.strWorkPackage AS 'W/Pack',
vwDataProblems.dtmDateRequired AS 'Date Rqd',
vwDataProblems.strPriority AS 'Priority',
vwDataProblems.strProblemOwnerName AS 'Owner',
vwDataProblems.strChangeType AS 'Change Type',
vwDataProblems.strProblemDetails AS 'Details',
vwDataProblems.strBusinessBenefits AS 'Bus Benefits',
vwDataProblems.strISReview AS 'IS Review',
vwDataProblems.dblTotalResourceDaysRequired AS 'Resource Total',
vwDataProblems.strProblemSummary AS 'Summary',
vwDataProblems.strPanelComments AS 'Panel Comments',
vwDataProblems.intID, vwDataProblems.dtmCreationDate
FROM FUSION_REPORTING.dbo.vwDataProblems vwDataProblems
WHERE (vwDataProblems.strSystem='ezBuy') AND
(vwDataProblems.bitStatusClosed=0) AND
(vwDataProblems.strStatus<'Existing Change Request Raised') OR
(vwDataProblems.strSystem='ezBuy') AND
(vwDataProblems.bitStatusClosed=1) AND (vwDataProblems.strStatus Like
'%Deferred%')
ORDER BY vwDataProblems.intProblemLogNo
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Save data retreived from query without saving query Anthony Excel Discussion (Misc queries) 0 January 25th 06 07:17 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 10:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"