1
Answer

Can anyone please give me a clue!

Photo of tlmy521

tlmy521

21y
1.5k
1
I got a question asked to generate a Sales report by using List Box control, at least one function and one sub-procedure must be used in the program. Need to use repetition and selection structure. Arrays are NOT allow to use in the program. The program needs to produce a summary of the day's sales, itemising each product, its quantity sold and earnings from those sales. It also need to report how much tax has been collected from the sale of products. Lastly, the program needs to provide a summary of the total earning from sales, and the total tax collected. product code: 1 for general, 2 for liquor Three text files are given for read into. General.txt contains: 132 McKane Frozen Peas (500g) 2.35 176 Kadberrie Chocolate Snacks 4.67 223 Rico’s Long Grain Rice (10kg) 7.52 247 Iced Donuts (6 pack) 1.98 liquor.txt contains: 198 Yarra Valley Cellars – Red (1L) 8.22 224 Gippsland Wine – White (1L) 9.79 469 Hunter Valley White Wine (2L) 11.23 470 Hunter Valley Red Wine (2L) 11.62 Sales.txt contains 132 1 21 176 1 15 198 2 6 223 1 12 224 2 4 247 1 17 469 2 10 470 2 3

Answers (1)

0
Photo of Muralidharan Deenathayalan
NA 11.9k 1.5m 12y
Here is another simple of doing this.

DECLARE @listContactIdStr VARCHAR(MAX)
select  @listContactIdStr COALESCE(@listContactIdStr+',' ,'') +ContactId from dbo.ContactGroupReln where ContactGroupId=@ContactGroupId

SELECT 
@listContactIdStr

Please let me know, if it is not helping you.
0
Photo of Anurag Sarkar
NA 2.4k 308k 12y
Please check this link and try the query out there http://www.c-sharpcorner.com/UploadFile/ff2f08/comma-separated-value-in-sql-query/