Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql query

Author  Topic 

afreen
Starting Member

3 Posts

Posted - 2013-02-16 : 00:32:31
Hi,
I have a table invoice whose fields are customer_name, invoice_id,total,balance .
invoiceid is the primary key whereas custoemer_name is the foreign key..

Now I want to group the invoice for each custoemr ...i want result something as

Shahrukh
Inv1 2000 1500
Inv2 3000 3000

Salman
Inv3 1000 0
Inv6 500 500

where
custoemrnames =sharukh,salman
invoice id=inv1,inv2,inv3,inv4
total= 2000 ,3000,1000,500
balance-1500,3000,0,500

The basic structure should be
customer_name
invoiceid total balance

I need this in a vb.net windows application..after getting this result how can I display it ..in a grdivew ? or how

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-16 : 02:26:54
one way is to use a reporting tool like SSRS where you can add a grouping based on customername and then show the other details within it

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

afreen
Starting Member

3 Posts

Posted - 2013-02-16 : 02:36:19
Im using crystal reports but the problem is if user clicks on invoice id then the invoice form with all its details will open where he can edit invoice details
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-16 : 02:49:13
you cant have write back on reporting tools atleast in ssrs. for that best thing would be to design a webpage which gives you an edit option

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

afreen
Starting Member

3 Posts

Posted - 2013-02-16 : 02:55:53
Im using windows applicaiton...how can i show the above details in a form...?and what is ssrs?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-16 : 03:06:19
ssrs is sql server reporting services

I dont have any app development experience so cant suggest on that. May be some others will be able to help you out.
Please try posting in some ASP.NET forums too

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -