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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:59:20+00:00 2026-06-15T12:59:20+00:00

I need to run a T-SQL query via the Microsoft Query interface, using an

  • 0

I need to run a T-SQL query via the Microsoft Query interface, using an IIf statement.

When I run the query, I get the error Missing FROM clause. This is odd, because the FROM clause is there. It fails because of the IIf but I have no idea why.

The code:

SELECT 
    TABLE1.NUMBER, 
    TABLE1.TEXT, 
    TABLE1.INT, 
    IIf(
        (
            (
                ((TABLE2.INT1-TABLE2.INT2) -TABLE2.INT3) -TABLE2.INT4
            ) > 0
        ), 
        (
            1
        ),  0) 
        as NEWCOL
FROM 
    DB.TABLEX TABLE1, 
    DB.TABLEY TABLE2
WHERE 
    TABLE2.NUMBER = TABLE1.NUMBER 
    AND TABLE1.NUMBER='991208000192'

The database is not mine, so I have to work with what I can. Does anyone have an idea what may cause the problem?

  • 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-15T12:59:21+00:00Added an answer on June 15, 2026 at 12:59 pm

    the SQLBase reference in http://enos.itcollege.ee/~priit/(I216)%20Ab-de%20administreerimine/SQLBase%20admin%20juhendid/LANG.PDF (Courtesy @twoleggedhorse) does not have function IIF in SQLBase. It has a function IF with similar syntax as your IIF.

    Try using @IF(CONDITION, TRUE_VAL, FALSE_VAL) in your SQL.

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

Sidebar

Related Questions

I want to run a sql query on a specific schedule (weekly) and need
I have a few sql scripts that I need to run via SQL*Plus. These
I have a raw sql query I need to run, but the database name
I am trying to get a sql query to run on drop down menu
I want to run sql query on an excel table: select * from Range[A1:Z50]
I need to run a SQL Query in vb.net to find the average rating
I have a reasonably long SQL query that I need to run in a
What is the most efficient way to get the sql query from EF? I
I have a MS SQL Query that is pulling data via from a remote
I hava again run it interesting problem, I need to dynamically build SQL query

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.