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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:17:59+00:00 2026-06-14T09:17:59+00:00

This is a follow up to my previous question Concatenate 2 rows in a

  • 0

This is a follow up to my previous question Concatenate 2 rows in a complex SQL query.

Here is what I got from this question:

PARAMETERS [CurrAxe] TEXT ( 255 ), [CurrOTP] TEXT ( 255 ), [CurrClient] TEXT (
255 ), [StartDate] DATETIME, [EndDate] DATETIME;

SELECT q.Projet, *
FROM   (faitssaillants f
LEFT JOIN employes e
ON f.utilisateur = e.cip)
INNER JOIN (
SELECT s1.otp,
     [s1].[valeur] & "," & [s2].[valeur] AS Projet
FROM   (
  SELECT otp, valeur
  FROM   tb_sommaire
  WHERE  [variable] = 'TitreMandat') AS s1
INNER JOIN (
   SELECT otp, valeur
   FROM   tb_sommaire 
   WHERE  [variable] = 'NomInstallation') AS s2
ON s1.otp = s2.otp) q
ON f.otp = q.otp
WHERE f.otp  = [currotp] 
AND f.client LIKE [currclient] 
AND f.axe LIKE [curraxe] 
AND Datevalue([dateinsertion]) 
    Between [startdate] And [enddate] 
ORDER  BY f.dateinsertion DESC; 

What if I would like to add another row (let’s name it s3) with [variable] = ‘something else’ instead of ‘TitreMandat’ or ‘NomInstallation’? Would it be possible to get all the tb_sommaire.variable as fields and tb_sommaire.valeur as values where tb_sommaire.otp = faitssaillants.otp? It would probably fix my future problems too.

  • 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-14T09:18:00+00:00Added an answer on June 14, 2026 at 9:18 am

    I would do your first solution in two queries including a crosstab. First query named qry1 SQL:

    SELECT 
      f.index, f.project, f.axe, f.client, f.otp, s.variable, s.valeur, 
      f.FaitSaillant, f.dateInsertion, f.Utilisateur, e.empname
    FROM 
      (FaitsSaillants AS f INNER JOIN 
      tb_SOMMAIRE AS s ON 
      f.otp = s.otp) LEFT JOIN 
      employes AS e ON 
      f.Utilisateur = e.cip;
    

    You can add your WHERE criteria to this query.

    2nd query, the crosstab one:

    TRANSFORM First(qry1.valeur) AS FirstOfvaleur
    SELECT qry1.index, qry1.project, qry1.axe, qry1.client, qry1.otp
    FROM qry1
    GROUP BY qry1.index, qry1.project, qry1.axe, qry1.client, qry1.otp
    PIVOT qry1.variable;
    

    then you can concatenate the valeurs for each variable

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

Sidebar

Related Questions

This is a follow-on from a previous question ( here ), but I'm working
This is a follow up from my previous question I have this code basically
This is a follow up to my previous question: Problem passing parameters via Iframe
This is a follow on from my previous question although this is about something
From my previous question for selecting specific html text, I have gone through this
This question follows on from a previous question which can be found here: Need
Just a follow up from a previous question. I've got the following form.. <body
This a follow-up to a previous question . How can I optimize this query
This is a follow-up on my previous question . Once I got the problem
This is a follow-up to my previous question (found here ). My properties files

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.