Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:31:19+00:00 2026-06-11T22:31:19+00:00

I am having problem in executing a linq to sql query. Please have a

  • 0

I am having problem in executing a linq to sql query. Please have a look.

Here is my code:

    SELECT c.client_name,
       n.instrument_group_id,
       n.trade_date,
       sum(n.buy_qty) AS TotBuyQty,
       sum(convert(float,n.buy_value) + convert(float,n.buy_brokerage)) AS TotBuyVal,
       sum(n.sell_qty) AS TotSellQty,
       sum(convert(float,n.sell_value) - convert(float,n.sell_brokerage)) AS TotSellVal,
       sum(convert(float,n.sell_value) - convert(float,n.sell_brokerage))- sum(convert(float,n.buy_value) + convert(float,n.buy_brokerage)) AS ProfitLoss
FROM nse_fo_transaction AS n
LEFT JOIN client_master AS c ON n.client_id = c.client_id
WHERE n.client_id = 5
  AND n.trade_date BETWEEN '09/01/2012' AND '09/19/2012'
GROUP BY c.client_name,
         n.instrument_group_id,
         n.trade_date
ORDER BY n.trade_date
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:31:20+00:00Added an answer on June 11, 2026 at 10:31 pm
    Dim query = (From n In tblNseFo.AsEnumerable _
                                Where n!client_id = intClientID _
                                Group Join c In tblClient _
                                On n!client_id Equals c!client_id Into cs = Group _
                                From c In cs.DefaultIfEmpty _
                                Group n, c By _
                                c!client_name, n!instrument_group_id, n!trade_date Into gs = Group _
                                Order By trade_date _
                                Select New With { _
                                    .client_name = client_name, _
                                    .instrument_group_id = instrument_group_id, _
                                    .trade_date = trade_date, _
                                    .TotBuyQty = gs.Sum(Function(x) x.n!buy_qty), _
                                    .TotSellQty = gs.Sum(Function(x) x.n!sell_qty), _
                                    .TotBuyVal = gs.Sum(Function(x) x.n!buy_value) + gs.Sum(Function(x) x.n!buy_brokerage), _
                                    .TotSellVal = gs.Sum(Function(x) x.n!sell_value) - gs.Sum(Function(x) x.n!sell_brokerage), _
                                    .ProfitLoss = (gs.Sum(Function(x) x.n!sell_value) - gs.Sum(Function(x) x.n!sell_brokerage)) - _
                                                  (gs.Sum(Function(x) x.n!buy_value) + gs.Sum(Function(x) x.n!buy_brokerage))})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with returning a list by executing a Select LINQ query.
I'm having problem with datagrid view. I have attached an image with the code
I'm having a problem to track the Sequence of executing the following code :
I'm having a problem executing a certain bit of AJAX. Here is how I
I am having problem with changing SQL query to preform faster. I need to
I am having a problem in executing the following code while searching in the
Having a problem executing a Python script from a .NET web service. The web
I'm having a problem with executing a stored procedure from Perl (using the DBI
Im having problem in my UIscrollView ,this is what I have done: Whenever a
I'm having a problem executing a command from a command line through an ASP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.