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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:05:30+00:00 2026-05-22T20:05:30+00:00

I have a column called DayShift in a table which is of Yes/No data

  • 0

I have a column called DayShift in a table which is of Yes/No data type (Boolean). The result Output I want is: if the value is true, display “Day” else display night.

I have tried the following:

SELECT iif(DayShift=Yes,"Day","Night") as Shift FROM table1;

SELECT iif(DayShift,"Day","Night") as Shift FROM table1;

SELECT iif(DayShift=True,"Day","Night") as Shift FROM table1;

SELECT iif(DayShift=1,"Day","Night") as Shift FROM table1;

But none of the above work. It just gives me a list of blank check boxes in the output datasheet window. I am using Ms Access 2003. Any help appreciated.

Update:

After a bit of research that the yes/no data type in Ms Access 2003 cannot handle null values appropriately. Hence, the error. Check this link for details.

Update 2

Real Query with the joins. Didnt mention it since i though the information provided above would work.

SELECT tblovertime.contfirstname                        AS [First Name], 
       tblovertime.contlastname                         AS [Last Name], 
       tblovertime.employeenumber                       AS [Employee Number], 
       tblsignup.thedate                                AS [Sign Up Date], 
       Iif([tblOvertime.DayShift] =- 1, "Day", "Night") AS shift, 
       (SELECT Mid(MIN(Iif(sector = 1, "," & sector, NULL)) & MIN( 
                               Iif(sector = 2, "," & sector, NULL)) & MIN( 
                               Iif(sector = 3, "," & sector, NULL)) & MIN( 
                           Iif(sector = 4, "," & sector, NULL)), 2) AS concat 
        FROM   tblempsectorlist 
        WHERE  tblempsectorlist.empnum = tblsignup.employeenumber 
        GROUP  BY empnum)                               AS sectors, 
       tblovertime.timedatecontact                      AS [Date Contacted], 
       tblovertimestatus.name                           AS status 
FROM   (tblsignup 
        INNER JOIN tblovertime 
          ON ( tblsignup.thedate = tblovertime.otdate ) 
             AND ( tblsignup.employeenumber = tblovertime.employeenumber )) 
       INNER JOIN tblovertimestatus 
         ON Clng(tblovertime.statusid) = tblovertimestatus.statusid 
WHERE  (( ( tblsignup.thedate ) ># 1 / 1 / 2011 # )) 
ORDER  BY tblsignup.thedate; 
  • 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-22T20:05:30+00:00Added an answer on May 22, 2026 at 8:05 pm

    Your second one has it right

    SELECT iif(DayShift,"Day","Night") as Shift FROM table1;
    

    I suggest trying the following to see what’s actually being evaluated

    SELECT iif(DayShift,"Day","Night") as Shift, DayShift FROM table1;
    

    You could equally do

    SELECT iif(DayShift = -1,"Day","Night") as Shift FROM table1;
    

    Since MS Access is storing true as -1 and false as 0 (it’s not as intuitive as true = 1, but it’s probably faster to evaluate in twos-compliment)

    — edit —
    Since you appear to be using a join, which can result in Nul’s for Yes/No’s, use the nz() function.

    select iff(nz(DayShift, 0), "Day","Night") as Shift FROM table1;
    

    When DayShift comes out null, this will return 0 (false/no) as a result instead.

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

Sidebar

Related Questions

I have a column called views in my table A. I want to increment
I have a column called THE_VALUE in a table TABLE_A , that holds data
I have a column called menu_order which has no default value. When I select
I have a DataTable that has a boolean column called [Invalid]. I need to
MS SQL Server 2000 I have a column in Table A called Name. I
I have a nullable DateTime column in my SQL Server 2005 table called DateTimeDeleted.
Suppose I have a table called Companies that has a DepartmentID column. There's also
I have a date and time column in my mysql table called start_date and
I have a table called ApprovalTasks... Approvals has a status column I also have
I need a select from table which does not have column that tells when

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.