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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:53:17+00:00 2026-05-24T07:53:17+00:00

I have an excel import from ODBC setup using MSQuery and all of the

  • 0

I have an excel import from ODBC setup using MSQuery and all of the data and rows I want are being returned fine there however when I send the data to my excel workbook I am missing 3 fields day, month & year Can anyone help find out why?

SELECT  contract_0.create_date AS 'Submitted Date', 
        -- abbreviating
        contract_0.install_date AS 'installed_US', 
        RIGHT(contract_0.install_date,2) AS 'day', 
        MID(contract_0.install_date,6,2) AS 'month',
        LEFT(contract_0.install_date,4) As 'year'
            -- abbreviating
FROM `web54-reiga-gms`.contact contact_0, `web54-reiga-gms`.contract contract_0, `web54-reiga-gms`.user user_0
WHERE contract_0.contact_id = contact_0.id AND contract_0.user_id = user_0.id

My MSQuery Code above

*EDIT **

I am using Excel 2010 on Windows 7 and MySQL ODBC 3.5

UPDATE **

CREATE TABLE `contract` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `installer` varchar(50) DEFAULT NULL,
  `fitter` varchar(50) DEFAULT NULL,
  `guarantee_no` varchar(50) DEFAULT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `equipment` varchar(32) DEFAULT NULL,
  `certificate_no` varchar(50) DEFAULT NULL,
  `install_date` date DEFAULT '0000-00-00',
  `create_date` date DEFAULT '0000-00-00',
  `edit_date` date DEFAULT '0000-00-00',
  `edited_by` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
  • 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-24T07:53:18+00:00Added an answer on May 24, 2026 at 7:53 am

    You are treating the install_date field as a string. It’s probably a Date or DateTime field and to get the individual year, month and day values you should use the extract function.

    OK. It is as I suspected and you are dealing with a Date. Replace these lines:

        RIGHT(contract_0.install_date,2) AS 'day', 
        MID(contract_0.install_date,6,2) AS 'month',
        LEFT(contract_0.install_date,4) As 'year',
    

    with these:

    EXTRACT(YEAR FROM contract_0.install_date) AS 'day', 
    EXTRACT(MONTH FROM contract_0.install_date) AS 'month',
    EXTRACT(DAY FROM contract_0.install_date) As 'year',
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to import data from an Excel file - assume Excel 2003 /
I have the unfortunate task of having to import data from excel into a
I want to import data from Excel worksheet into SQL Server database (2008). I
I'm using the Apache BeanUtils setProperty method to import data from an Excel file
I'm using the NPOI Library to import some data from an excel sheet to
I am trying to import data from excel to Sql Server using Import wizard.
I have a client who needs to import rows from a LARGE Excel file
I have written an Excel VBA macro which imports data from a HTML file
I have a C#/.Net job that imports data from Excel and then processes it.
I am trying to import data from Access to Excel based on two parameters.

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.