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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:45:09+00:00 2026-05-15T20:45:09+00:00

I am trying to populate a date table which contains every date for the

  • 0

I am trying to populate a date table which contains every date for the next 35 years with information regarding each day.

My ERP system has an accounting years table (GLRULE) which specifies the accounting periods for each specific year since many companies do not work on Calendar Months.

The GLRule table contains one record for each period and looks like this:

fcbasis  fcname    fcstatus  fdend              fdstart            flisadjust  flisaudit  fnnumber  freval  identity_column
A        FY 2000   C         1/28/2000 0:00:00  1/1/2000 0:00:00   FALSE       FALSE      1         FALSE   37
A        FY 2000   C         2/25/2000 0:00:00  1/29/2000 0:00:00  FALSE       FALSE      2         FALSE   38
A        FY 2000   C         3/31/2000 0:00:00  2/26/2000 0:00:00  FALSE       FALSE      3         FALSE   39
A        FY 2000   C         4/28/2000 0:00:00  4/1/2000 0:00:00   FALSE       FALSE      4         FALSE   40
A        FY 2000   C         5/26/2000 0:00:00  4/29/2000 0:00:00  FALSE       FALSE      5         FALSE   41
A        FY 2000   C         6/30/2000 0:00:00  5/27/2000 0:00:00  FALSE       FALSE      6         FALSE   42

Anyway, I can update my date table one field at a time with a query similar to this:

UPDATE redfridaydates.dbo.testdates 
   SET [FISCAL_PERIOD]   = 
                (SELECT fnnumber
                  FROM m2mdata01..glrule GLR
                  where DATE >= GLR.FDSTART and DATE <= GLR.FDEND)

Is there a better way to update multiple fields at a time? I’m not sure how I can do so since I do not have a join.

  • 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-15T20:45:10+00:00Added an answer on May 15, 2026 at 8:45 pm

    It sounds like the table you’re trying to update has one record for every date. The answer assumes that. If you can ensure that your GL datasource has no overlapping dates:

    UPDATE T
    SET T.[FISCAL_PERIOD] = GLR.fnnumber,
         T.Foo = GLR.Bar,
         T.Bat = GLR.Baz  --etc.
    
    FROM redfridaydates.dbo.testdates  AS T
    INNER JOIN m2mdata01..glrule AS GLR
    ON T.[Date] BETWEEN GLR.FDSTART  AND GLR.FDEND
    

    If you’re interested, here’s a proof of concept on some test data.

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

Sidebar

Related Questions

I am trying to populate a List<Image> by reading the name of the each
More problems with dates. Basically I'm trying to populate a table with some datetime
I'm trying to setup a date lookup table as in this: http://www.techrepublic.com/blog/datacenter/simplify-sql-server-2005-queries-with-a-dates-table/326 but the
I was trying to populate a table with dates for a whole year except
I'm trying to populate a form SELECT with OPTIONS from a table in my
I am trying to populate a selection box (dropdown) from a mysql table in
This is schoolwork.. I'm trying to create a table that has a default date
I am trying to populate a drop-down box which I have created in the
I am trying to build a DataTable to populate a DataGrid in VB.NET. The
I am trying populate H3 with the sum of column E for rows that

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.