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

  • Home
  • SEARCH
  • 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 8828333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:34:54+00:00 2026-06-14T07:34:54+00:00

I am trying to open another table and get some values inside of an

  • 0

I am trying to open another table and get some values inside of an inner join

The problem is that I have tons of errors and it can’t run. I guess that I have somthing wrong in the syntax. Here my code is:

INNER JOIN (SELECT (min(TA_Timestamp)as timestampmin,ta_wp_id as ta_wp_id) as test 
ON test.ta_wp_id = p17.PA_WP_ID
FROM ta_tasks WHERE test.ta_wp_id = p17.pa_wp_id)

The table I’m trying to get the results is named ta_tasks it contains a field named ta_wp_id. The other table is named parameters and it contains a row named pa_wp_id

what I need is to get the min(TA_Timestamp) from ta_tasks when ta_wp_id = pa_wp_id

Is there a solution?

  • 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-14T07:34:55+00:00Added an answer on June 14, 2026 at 7:34 am

    Looks like you’re missing a GROUP BY and your syntax is a little off. Try this:

    SELECT
        p1.pa_value as SDay,
        p2.pa_value as SMonth,
        p3.pa_value as SYear,
        p4.pa_value as EDay,
        p5.pa_value as EMonth,
        p6.pa_value as EYear,
        SUBSTRING(p7.PA_NAME,11, len(p7.PA_NAME)) as _index_,
        p8.pa_value as _status_,
        p9.pa_value as approved_CHECK_status,
        p10.pa_value as expense_type_CHECK,
        p11.pa_value as congress_name,
        p12.pa_value as _Initiator_,
        p13.pa_value as planned_budget,
        p14.pa_value as actual_budget,
        p15.pa_value as congressNumHCP,
        p16.pa_value as congressNumMSD,
        p17.pa_value as RequestNumber,
        test.timestampmin    
    
    FROM WP_WorkflowProcess p
    LEFT JOIN PA_Parameter p1 on p1.PA_WP_ID=p.wp_id AND p1.PA_NAME = 'Event_Day_From'
    LEFT JOIN PA_Parameter p2 on p2.PA_WP_ID=p.wp_id AND p2.PA_NAME = 'Event_Month_From'
    LEFT JOIN PA_Parameter p3 on p3.PA_WP_ID=p.wp_id AND p3.PA_NAME = 'Event_Year_From'
    LEFT JOIN PA_Parameter p4 on p4.PA_WP_ID=p.wp_id AND p4.PA_NAME = 'Event_Day_To'
    LEFT JOIN PA_Parameter p5 on p5.PA_WP_ID=p.wp_id AND p5.PA_NAME = 'Event_Month_To'
    LEFT JOIN PA_Parameter p6 on p6.PA_WP_ID=p.wp_id AND p6.PA_NAME = 'Event_Year_To'
    LEFT JOIN PA_Parameter p7 on p7.PA_WP_ID=p.wp_ID
        AND ((p7.PA_NAME like 'reqExpense_' AND CAST( p7.PA_wp_id as varchar(15) ) like CAST( p.wp_id as varchar(5) ) COLLATE DATABASE_DEFAULT ) 
        OR (p7.PA_NAME like 'reqExpense__' AND CAST( p7.PA_wp_id as varchar(15) ) like CAST( p.wp_id as varchar(5) ) COLLATE DATABASE_DEFAULT) )
    LEFT JOIN PA_Parameter p8 on p8.PA_WP_ID=p.wp_id AND p8.PA_NAME = 'EventStatus'
    LEFT JOIN PA_Parameter p9 on p9.PA_WP_ID=p.wp_id AND p9.PA_NAME = 'MAapproval'
    LEFT JOIN PA_Parameter p10 on p10.PA_WP_ID=p.wp_id AND p10.PA_NAME = 'reqExpense'+ SUBSTRING(p7.PA_NAME,11, len(p7.PA_NAME))
    LEFT JOIN PA_Parameter p11 on p11.PA_WP_ID=p.wp_id AND p11.PA_NAME = 'EventNameReal'
    LEFT JOIN PA_Parameter p12 on p12.PA_WP_ID=p.wp_id AND p12.PA_NAME = 'Requisitioner'
    LEFT JOIN PA_Parameter p13 on p13.PA_WP_ID=p.wp_id AND p13.PA_NAME = 'Preliminary_BudgetText'
    LEFT JOIN PA_Parameter p14 on p14.PA_WP_ID=p.wp_id AND p14.PA_NAME = 'Final_BudgetText'
    LEFT JOIN PA_Parameter p15 on p15.PA_WP_ID=p.wp_id AND p15.PA_NAME = 'congressNumberHCP'+SUBSTRING(p7.PA_NAME,11, len(p7.PA_NAME))
    LEFT JOIN PA_Parameter p16 on p16.PA_WP_ID=p.wp_id AND p16.PA_NAME = 'congressNumberMSD'+SUBSTRING(p7.PA_NAME,11, len(p7.PA_NAME))
    LEFT JOIN PA_Parameter p17 on p17.PA_WP_ID=p.wp_id AND p17.PA_NAME = 'RequestNumber'
    INNER JOIN
    (
        SELECT min(TA_Timestamp) as timestampmin, ta_wp_id as ta_wp_id
        FROM ta_tasks
        GROUP BY ta_wp_id
    ) as test 
        ON test.ta_wp_id = p17.PA_WP_ID
    
    WHERE p.wp_type='EventManagementNew'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to simulate some code that I have working with SQL but using
I have a table that contains data that I am trying to import into
I am having a problem when trying to get jquery to close an open
EDIT: Database names have been modified for simplicity I'm trying to get some dynamic
I am trying to open one window from another using makeKeyAndOrderFront. The new window
I am trying to export some data from a SQL Express table to Access
Another question from an app programmer who's trying the first time to get together
So basically I have a main table, and I want to filter that data
I have a casting problem. I am writing a code to open all the
Im having some troubles trying to get the info stored in my database and

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.