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 3442068
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:37:36+00:00 2026-05-18T08:37:36+00:00

I have a query like this…. selectLeaveDetails = SELECT UL.[PK_ID],UD.FIRST_NAME + ‘ ‘ +

  • 0

I have a query like this….

selectLeaveDetails = 
   "SELECT  UL.[PK_ID],UD.FIRST_NAME + ' ' + UD.LAST_NAME AS REQUESTBY," +
   "UL.[DATE_FROM] AS FROMDATE,UL.[DATE_TO] AS TODATE," +
   "UL.LEAVE_REQUEST_ON AS REQUESTON," +
   "REPLACE(UL.LEAVE_REQUEST_NOTES, '\n', '<br />') AS REQUESTNOTES," +
   "STATUS=CASE " +
   " WHEN UL.[LEAVE_STATUS] = '1' THEN 'ACTIVE' " +
   " WHEN UL.[LEAVE_STATUS] = '-1' THEN 'CANCELLED' " +
   " WHEN UL.[LEAVE_STATUS] = '2' THEN 'REPLACED' END," +
   "UL.LEAVE_RESPONSE_ON AS RESPONSEON," +
   "ULL.FIRST_NAME + ' ' + ULL.LAST_NAME AS RESPONSEBY," +
   "UL.[LEAVE_RESPONSE_NOTES] AS RESPONSENOTES,UL.FK_LEAVE_REQUESTER " +
   "FROM (M_USER_LEAVES UL " +
   "INNER JOIN M_LEADERLED MLL ON MLL.LED_ID = MUD.PK_ID WHERE MLL.LEADER_ID = '" + Session["UserID"].ToString() ****" +****
   "LEFT JOIN M_USER_DETAILS UD ON UD.PK_ID = UL.FK_LEAVE_REQUESTER) " +
   "LEFT JOIN M_USER_DETAILS ULL ON ULL.PK_ID = UL.FK_LEAVE_RESPONSE_BY " +
   " WHERE UL.DATE_FROM BETWEEN '01/01/" + cmbYearList.SelectedItem.Text + "' AND '12/31/" + cmbYearList.SelectedItem.Text + "'" +
   " AND UD.ACTIVE=1";

In the cmbYearList.SelectedItem.Text + "' AND '12/31/" + cmbYearList.SelectedItem.Text + "'" query…only assignment,increment,decrement error is thrown

Can anyone help me?

  • 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-05-18T08:37:36+00:00Added an answer on May 18, 2026 at 8:37 am

    Your FROM clause is somehow pretty mangled up:

    FROM (M_USER_LEAVES UL 
           INNER JOIN M_LEADERLED MLL ON MLL.LED_ID = MUD.PK_ID 
           WHERE MLL.LEADER_ID = 'XXXX" 
           LEFT JOIN M_USER_DETAILS UD ON UD.PK_ID = UL.FK_LEAVE_REQUESTER) 
    

    You have an INNER JOIN, then a WHERE clause, followed by a LEFT JOIN …. this seems pretty odd….. what exactly are you trying to do here?? Why do you need to put this into a subquery – can’t you just INNER JOIN and LEFT JOIN those tables into a single statement and define the necessary WHERE constraints?

    Also, your WHERE clause in here gets an opening single quote and a closing double quote – that won’t work ……

    WHERE MLL.LEADER_ID = 'XXXX" 
                         ***   ***
    

    You need to get your SQL query working in SQL Server Management Studio first – then transfer it into your C# code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query like this: SELECT lesson.id, p1.first_name, p1.surname, start_time, instrument.name FROM lesson,
I have MySQL query like this SELECT `transaction`.id, CONCAT(contact.`name`, , contact.last_name) as fullName, (SELECT
I have a query like this: SELECT TABLE_NAME, COLUMN_NAME, IS_NULLABLE, DATA_TYPE FROM MY_DB.INFORMATION_SCHEMA.COLUMNS WHERE
I have a query like this: SELECT t1.id, (SELECT COUNT(t2.id) FROM t2 WHERE t2.id
I have a query like this: SELECT COUNT(*) AS amount FROM daily_individual_tracking WHERE sales
Say I have a query like this: select ((amount1 - amount2)/ amount1) as chg
I have a simple query like this: select * from mytable where id >
I have a MySQL query like this: SELECT *, SUM(...some SQL removed for brevety)
I have a query like this: SELECT jobs.*, ( CASE WHEN lead_informations.state IS NOT
I have a query like this: SELECT TaFellesVaktjournal.*, TaBygg.ByggNavn FROM TaFellesVaktjournal LEFT JOIN TaBygg

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.