Quantcast
Channel: SQLServerCentral » Reporting Services » Reporting Services » Latest topics
Viewing all articles
Browse latest Browse all 2791

Need to retrieve first occurrence of Invoice detail

$
0
0
Hello, New to this so bear with me please...I have a query which contains detail of all invoices but I only need to retrieve for my report the first record for each invoice...Here is the query I have for my report.SELECT V_Phocas_Sales_All_Inner.Customer ,V_Phocas_Sales_All_Inner.[Customer Name] ,V_Phocas_Sales_All_Inner.[Invoice Number] ,V_Phocas_Sales_All_Inner.[Line Number] ,V_Phocas_Sales_All_Inner.[Invoice Release Date] ,V_Phocas_Sales_All_Inner.[Miscellaneous Sales] ,V_Phocas_Sales_All_Inner.[Freight Amount] ,V_Phocas_Sales_All_Inner.[Invoice Total] ,V_Phocas_Sales_All_Inner.[Sales Tax Amount]FROM V_Phocas_Sales_All_InnerWHERE V_Phocas_Sales_All_Inner.[Stream Name] = N'Sales' and V_Phocas_Sales_All_Inner.Customer = @Customerand V_Phocas_Sales_All_Inner.Date between @StartDate and @EndDateand V_Phocas_Sales_All_Inner.[Miscellaneous Sales] != N'0'Order byV_Phocas_Sales_All_Inner.[Invoice Number] ASC, V_Phocas_Sales_All_Inner.[Line Number] ASClooked on several forums but cannot seem to find the answer, any help would be great.Regards,rproulx

Viewing all articles
Browse latest Browse all 2791

Trending Articles