473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

convert calculated field to ms sql server 2000

Anyone know how can I convert this field to ms sql server?

IIf([Final]=0 Or IsNull([Final]),"--",[Final]) AS FinalGrade,
SchYrSemCourseJoin.Final, IIf([Final]=0 Or
IsNull([Final]),"--",[Unit]) AS UnitAlias
this is the full sql statement in my ms access program:

SELECT DISTINCTROW Students.IDNo, [LastName] & ", " & [FirstName] & "
" & [MiddleName] AS Name, Students.Address, Students.PlaceofBirth,
Students.DateofBirth, Students.ParentGuardian, Students.ElemSchool,
Students.ESAddress, Students.ESSchYear, Students.SecSchool,
Students.SSAddress, Students.SSSchYear, Students.TerSchool,
Students.TSAddress, Students.TSSchYr, Program.ProgramTitle,
Program.ProgramDesc, IIf([ProgramTitle]="BEED","with concentration in
" & [Major],[Major]) AS MajorTemp, [Sem] & " Semester, " & [SchYr] AS
SchYrSem, Course.CourseCode, Course.CourseTitle, IIf([Final]=0 Or
IsNull([Final]),"--",[Final]) AS FinalGrade, SchYrSemCourseJoin.Final,
IIf([Final]=0 Or IsNull([Final]),"--",[Unit]) AS UnitAlias,
Students.IDNo, SchYrSem.SchYrSemID, SchYrSemCourseJoin.Annotation
FROM (Program INNER JOIN Students ON Program.ProgramID =
Students.ProgramID) INNER JOIN ((Major INNER JOIN SchYrSem ON
Major.MajorID = SchYrSem.MajorID) INNER JOIN (Course INNER JOIN
SchYrSemCourseJoin ON Course.CourseID = SchYrSemCourseJoin.CourseID)
ON SchYrSem.SchYrSemID = SchYrSemCourseJoin.SchYrSemID) ON
Students.IDNo = SchYrSem.IDNo

the only problem i have encounted is the FinalGrade and UnitAlias
Field as stated above.

Thanks in advance for any help.
Nov 13 '05 #1
2 2959
> Anyone know how can I convert this field to ms sql server?

IIf([Final]=0 Or IsNull([Final]),"--",[Final]) AS FinalGrade,
SchYrSemCourseJoin.Final, IIf([Final]=0 Or
IsNull([Final]),"--",[Unit]) AS UnitAlias

You could try something like

SELECT .....

FinalGrade =
(CASE [Final]
WHEN 0 THEN '--'
WHEN NULL THEN '--'
ELSE [Final]
END) ,
SchYrSemCourseJoin.Final,
UnitAlias =
(CASE [Final]
WHEN 0 THEN '--'
WHEN NULL THEN '--'
ELSE [Unit]
END)

......FROM

Cheers,
Peter

Nov 13 '05 #2
Thank you.

On Thu, 17 Feb 2005 09:09:07 GMT, "Peter Hoyle"
<pe*********@ntlworld-NOT.com> wrote:
Anyone know how can I convert this field to ms sql server?

IIf([Final]=0 Or IsNull([Final]),"--",[Final]) AS FinalGrade,
SchYrSemCourseJoin.Final, IIf([Final]=0 Or
IsNull([Final]),"--",[Unit]) AS UnitAlias

You could try something like

SELECT .....

FinalGrade =
(CASE [Final]
WHEN 0 THEN '--'
WHEN NULL THEN '--'
ELSE [Final]
END) ,
SchYrSemCourseJoin.Final,
UnitAlias =
(CASE [Final]
WHEN 0 THEN '--'
WHEN NULL THEN '--'
ELSE [Unit]
END)

.....FROM

Cheers,
Peter


Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: imani_technology_spam | last post by:
I'm trying to create an OLAP system using SQL Server 2000 Analysis Services (AS). I want the AS cube to be based on a database with a star schema. I have a field called Ratio. The initial...
1
by: SD | last post by:
Hi, This is driving me nuts, I have a table that stores notes regarding an operation in an IMAGE data type field in MS SQL Server 2000. I can read and write no problem using Access using the...
5
by: Axel | last post by:
Hi in T-SQL, (how) is it possible to concatenate 3 (varchar) fields into one; either in a SQL query or through a calculated field (or using a view, if anybody can explain to me how to use...
14
by: Allen Browne | last post by:
Subform is based on a single-table query that contains a calculated field: Amount: Round(CCur(Nz(*,0)),2) Continuous subform displays this field in a text box named Amount. As user enters new...
10
by: John young | last post by:
I have a table which has fields "year", "odometer", and "annual".... what i currently do is enter manually data for all fields,... what i want to have happen is the annual figure to be added...
1
by: tconway | last post by:
I have an Access program that displays Customer data into a form and OrderID data into a subform. The totals in the Subform are based on calculated fields, i.e. the Total Amount field Calculates...
2
by: John | last post by:
I am using Access 2000. One table in my database has a field called RankName. Values inlcude: Officer, Sergeant, Lieutenant. I need create a report that groups these three RankNames into two...
2
by: markm75c | last post by:
Does anyone know of a way to sort a column which isnt databound or an actual field in the database, but is derived from a method? IE. I have a grid showing stats for softball, with a calculated...
1
by: Greg (codepug | last post by:
Access 2000 Using a textbox of a single form, I created a calculated field. The following code is in the Control Source for this field: =IIf(=24,+(/),/ ) The numbers that are calculated are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.