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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:58:23+00:00 2026-06-15T00:58:23+00:00

I am using report builder with Excel as my data source. I am having

  • 0

I am using report builder with Excel as my data source. I am having a hard time creating a query text in the query designer. I get errors when i try conditional statements of simple group statements.

I have this statement:

 SELECT [Flight No],[Full Name],[Date],[Selected Routing 1] AS Routing,
 [Selected ETD 1] AS ETD,[Selected ETA 1] AS ETA
 FROM [Sheet1$]

this will return these values:

 Flight No   Full Name     Date       Routing   ETD   ETA
 1           Peter Hansen  10/1/2012  BNE-MEL   1755  2020
 2           Black Hansen  10/2/2012  BNE-MEL   1756  2021+1

Now, i want to create a conditional statement that when ETA has a +1 on its number then the date will add 1. so the table should look like these:

 Flight No   Full Name     Date       Routing   ETD   ETA
 1           Peter Hansen  10/1/2012  BNE-MEL   1755  2020
 2           Black Hansen  10/3/2012  BNE-MEL   1756  2021+1

I seem to get an error when i try to have an SQL statement like this in the report builder:

 SELECT [Flight No],[Full Name],If([Selected ETA 1] LIKE '*+*',[Date]+1,[Date]) 
 AS DATE, [Selected Routing 1] AS Routing,[Selected ETD 1] AS ETD,
 [Selected ETA 1] AS ETA
 FROM [Sheet1$]

The error says:

 An error occurred while executing the query.
 ERROR [42000撛] [Microsoft][ODBC Excel Driver] Undefined function 'if' in expression.
 (Microsoft SQL Server Report Builder)

 ERROR [42000撛] [Microsoft][ODBC Excel Driver] Undefined function 'if' in expression.     
 (ACEODBC.DLL)

Please give me references if possible. Thanks!

  • 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-15T00:58:24+00:00Added an answer on June 15, 2026 at 12:58 am

    As you can see in the error, the IF function has not been implemented for usage in that context. Your best bet to get this working is by using CASE instead:

    SELECT [Flight No],[Full Name]
        , CASE WHEN [Selected ETA 1] LIKE '*+*' THEN [Date]+1 ELSE [Date] END AS [DATE]
        , [Selected Routing 1] AS Routing ,[Selected ETD 1] AS ETD,
    [Selected ETA 1] AS ETA
    FROM [Sheet1$]
    

    Please note that you should avoid using reserved keywords as object names. I’m referring to that columns which you’re aliasing as [DATE]. Date is a data type since SQL Server 2008.

    Now that we’ve gone into the best practices direction, I wouldn’t use spaces in object names either. It saves you the hassle of needing to type those square brackets each time when writing a query.

    And to finish I would look into a method of importing the Excel sheet in a real database instead of referencing it directly from the report. Even though it works, it’s not really recommended. Any user with access to the file can mess it up so that your report breaks.

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

Sidebar

Related Questions

I'm using SQL Server 2008 with Report Builder 2.0 to try and query data
I'm using Report Builder 2.0 to construct a report that contains datetime data stored
I'm building a report using Report Builder 3.0. The source system I'm working with
How to bind data source to Report Viewer. I am using report viewer and
I am creating SSRS Report using Microsoft SQL Server Report Builder 3.0. I am
I'm trying to use Report Builder 2.0 to query a Sharepoint List using an
I created a report (using Report Builder 3.0) which has two page newsletter style
The situation: I am generating reports using Report Builder 2.0 and a Report Model
I have a problem with a report that is build using report builder 2.0,
I've created a report using SQL Server Report Builder 2008. I was wondering if

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.