Thread: MORE SQL Help
View Single Post
  #10 (permalink)  
Old 04-04-08, 01:04 PM
MartinS's Avatar
MartinS MartinS is offline
Senior Member
 

Join Date: Jul 2002
Location: Redhill, Surrey
Posts: 1,552
MartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the seaMartinS paddles in the sea
Small problem - although it works perfectly with the specific selection, there are another 8 that need the same change, but using the same code it doesn't work when one of more of the of the fields I'm checking against are from the Financial table and even though I've spent the morning messing around with the SQL to try and get it to work, I can't

I also noticed that there could be a time when the user wanted to show Final records only, so modified the temporary selection code (where required) as follows:

INNER JOIN (SELECT ValuationID, MAX(InputStage) AS IStage
FROM Financial F GROUP BY ValuationID) AS FIN ON FIN.ValuationID = V.ValuationID AND IStage = 2

I have a fixed piece of SQL for each selection, and can append the extra code using string.Format when the condition is true, but I just want to check that this is the right place to insert this?
Thanks in advance
Martin
__________________
Never test the depth of the water with both feet!
69 Divers SAC
Yorkshire Divers
Reply With Quote