Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Stored Procedure
Message
 
 
À
26/07/2010 14:21:41
Andy Roth
Neyenesch Printers
Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01473624
Message ID:
01473952
Vues:
28
>>>From the quick glance there is nothing bad in the SP.
>>>
>>>1. What is your SQL Server version and do you have latest SP installed (SP3 for 2005)
>>>
>>>2. Did you try to probably split this query into 2 steps - step 1 - just select, no group by in CTE and step 2 - group by
>>>
>>>3. Did you close and re-open SSMS?
>>>
>>>4. Try passing dates in ISO format '20100601' '20100630'
>
>I cut one of the OR conditions out the SP and it ran. Problem must be that SQL 2005 does not like the OR in the WHERE clause

Try moving both criteria (both OR) into JOIN conditions. Having them in WHERE transforms your LEFT JOIN into Inner JOIN at present.

Check http://beyondrelational.com/blogs/naomi/archive/2010/03/22/why-left-join-doesn-t-bring-all-records-from-the-left-table.aspx
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform