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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:28:04+00:00 2026-05-29T23:28:04+00:00

Before we start, I apologize for my MYSQL novice status. I’m trying to self-teach

  • 0

Before we start, I apologize for my MYSQL novice status. I’m trying to self-teach and struggling a bit with basic the basic structure.

Background on my question: Consider a company that issues bills once a quarter… and roughly two months after the end of the last quarter. I have a table (Quarter_Identify) that has several columns:

  • Quarter_Start EX: 01-01-2010
  • Quarter_End EX: 03-31-2010
  • Quarter_Ident EX: 1000 <— iterating number for each quarter (next
    quarter will be 1001)
  • Date_Billed This is the field I’m trying to populate from another table

The other table (Billing_List_1) contains:

  • Date_Billed EX: 05-23-2010
  • Lots of other nonsense related to the customers

We take all the orders during the quarter, and bill about 60 days after it ends. So, in the example above, the 5-23-2010 billing would be related to the Jan – Mar quarter (we bill really late). I would like to take this date and populate it back as the Date_Billed associated with Quart_Ident “1000”.

I’m fairly close and from my research I think I’m running into the issue that my “Where” clause includes a reference to the as-yet not created table “Skyline”. The “skyline” table gets everything together, but is essentially off by a month (I gave up trying to figure out the DateDiff function). So, I use the bottom piece to offset the result by one and get the right answer… except that it tells me I have an unknown column in my where clause (error 1054) the issue.

Select * from
    (select Billing_List_1.date_billed, quarter_identify.quarter_start,
      quarter_identify.quarter_end, quarter_identify.quarter_ident from Billing_List_1
    join quarter_identify
    on Billing_List_1.date_billed > quarter_identify.quarter_start 
      and Billing_list_1.date_billed < quarter_identify.quarter_end)
as SKYLINETABLE;

update quarter_identify A
    set A.date_Billed = SKYLINETABLE.date_Billed 
    where A.quarter_ident = SKYLINETABLE.quarter_ident - 1

Any thoughts would be much appreciated. Have a great evening all.


Solution per TEEZ: Thanks again for the great help.

update quarter_identify A Left join 
    (Select * from
        (select     Billing_List_1.date_billed, 
                    quarter_identify.quarter_start, 
                    quarter_identify.quarter_end, 
                    quarter_identify.quarter_ident from billing_list_1
        join quarter_identify
        on Billing_list_1.date_billed > quarter_identify.quarter_start 
        and Billing_list_1.date_billed < quarter_identify.quarter_end) 
    as T)
    as SKYLINETABLE on 1
    set A.date_billed = SKYLINETABLE.date_billed 
    where A.quarter_ident = SKYLINETABLE.quarter_ident - 1
  • 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-29T23:28:05+00:00Added an answer on May 29, 2026 at 11:28 pm

    I think you are wrong. what is SKYLINE table in update query?

    You are joining tables in update query but table is not specified. you should use your first query in join with update query.

    you need to use join SKYLINETABLE in join with your update query.

    Like below:

    update quarter_identify A left join (Select * from
        (select Billing_List_1.date_billed, quarter_identify.quarter_start,
          quarter_identify.quarter_end, quarter_identify.quarter_ident from Billing_List_1
        join quarter_identify
        on Billing_List_1.date_billed > quarter_identify.quarter_start 
          and Billing_list_1.date_billed < quarter_identify.quarter_end)) as SKYLINETABLE on[... specify on condition....]
        set A.date_Billed = SKYLINETABLE.date_Billed 
        where A.quarter_ident = SKYLINETABLE.quarter_ident - 1
    

    Please do required changes

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

Sidebar

Related Questions

Before I start, I apologize for a bad title but I could not come
Before start I have been trying to accomplish it for some time now, but
Before I start, I have to apologize for bringing up another case of permutations
I apologize if this has been asked before but I am trying to parse
Before start let me tell my experience: I am experienced with C#.NET, web services,
I want to get one record before start date and end date DtpFrom means
Am using Mediainfo library in my C# project,before start invoking this dll,i just ran
I usually try to do TDD with not much analysis (no diagrams) before start
I am working on a Media up-loader which uploads images to Server. Before start
before I start I want to point out that I tagged this question as

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.