A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Switch not working



 
 
Thread Tools Display Modes
  #11  
Old July 2nd, 2008, 09:05 PM posted to microsoft.public.access.queries
Student Databaser
external usenet poster
 
Posts: 29
Default Switch not working

It worked!!!!!! Thank you Thank you Thank you!


"John Spencer" wrote:

Is demographic.Work a number field or a text field. In one place you treat it
as a number field 14 and elsewhere as a text field "1". I am going to guess
it is a text field.


SELECT DEMOGRAPHIC.WORK
, STUDENT_COURSE.DATE_OF_REGISTRATION
, DEMOGRAPHIC.WORK
, STUDENT.STUDENT_ID
, IIF(Demographic.Work in ("1","2","3") or Demographic.Work is
null,Demographic.Work,"19") as CalcValue
FROM (STUDENT INNER JOIN DEMOGRAPHIC
ON STUDENT.STUDENT_ID =
DEMOGRAPHIC.STUDENT_ID) INNER JOIN STUDENT_COURSE
ON STUDENT.STUDENT_ID = STUDENT_COURSE.STUDENT_ID

CalcValue is the name of the value that is calculated in the expression.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

Student Databaser wrote:
Ok, sorry i wasn't clear. Here are a few rows of what the query returned.
What didn't work is that it didn't make numbers 4-19 appear as 19 for the
work field, and under CalcValue it says #Error. I assume this is because i
should have entered in some other field or expression but i was sure what
John meant.

Thanks so much for your help! I am obviously a novice at this and these
forums really help me to learn.

Expr1000 DATE_OF_REGISTRATION WORK STUDENT_ID CalcValue
4 2/13/2008 4 aa0703go
#Error
2 8/28/2007 2 ab0101ja
#Error
2 9/10/2007 2 ab0101ja
#Error
2 9/10/2007 2 ab0101ja
#Error
8 7/18/2006 8 ab0109na
#Error
18 10/17/2007 18 ab0601sa #Error



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.