Ask a Question related to Coldfusion Database Access, Design and Development.
-
quiero mas #1
query tweaking
Getting an error - Mike havent put in the extra column yet - just test running
at the moment. Sql at the bottom.
Language: Table
Language_id Language_name
1 ???????
2 ???????
3 ???????
4 ??????????
5 ??????
6 ???????
7 ???????
Hospital: Table
Hospital_id Hospital_name ??????? ??????? ??????? ????? ?????? ???????
1 Sapporo Hokkaido Yes Yes No No No No
2 Dental?Treatment?Centre No Yes No No No No
3 Health?University?of?Hokkaido? No Yes No No No No
4 Higashi?Sapporo?Hospital Yes Yes No No No No
5 Hokkaido?University?Hospital Yes No No No No No
6 National?Sapporo?Hospital Yes No No No No No
7 Sapporo?Hospital Yes No No No No No
8 Sapporo?Medical? Yes No No No No No
LanguagesbyHospital: Table
hospital_id language_id
1 1
4 1
5 1
6 1
7 1
8 1
1 2
2 2
3 2
4 2
The Sql
SELECT Hospital_name
FROM Hospital
INNER JOIN
LanguagesbyHospital ON LanguagesbyHospital.Hospital_id=Hospital.Hospital_ id
INNER JOIN
Language ON Language.Language_id=LanguagesbyHospital.Language_ id, "Language"
WHERE Language.Language_name= 'English'
quiero mas Guest
-
tweaking cf validation
i want to edit the js validation for html cfforms. can anyone tell me where the file that contains the js is located? i need to comment out the... -
Tweaking 'Create a New Php Script' file
File > New > Create New PHP Script generates the same basic code everytime. How can I add a new line of code to that file so that everytime I create... -
Tweaking cfchart
I am trying to construct a scatter chart where points are displayed from 0.85 to 1.15, I also would like to control the distance between the points... -
tweaking acks and pings
dslreports.com tweaks page recommends that I turn on "selective acks", but gives only the windows method for doing so. Also, my machine is... -
tweaking digital photo
I have a digital camera which i would like to take a photo of different rooms in my house,and then with the use of a program change the floor color... -
Scott*e #2
Re: query tweaking
the error is?
id say it is on the line
Language ON Language.Language_id=LanguagesbyHospital.Language_ id, "Language"
the error being the text after the comma.
Scott*e Guest
-
quiero mas #3
Re: query tweaking
?????????????e
Sorry i meant to say that i can oull the results from the query and that was
the error.
Im really in the dark as anyone who has been puttting up with my inane
questions will know. I went back and checked things. I went into Access and
got sql rolling fine in there - i thought i might just be able to paste the
sql from there but without luck.
i would appreciate any feedback
regards MArk - thinking of changing my name to NOOB
The Sql
<cfquery name="lbyh" datasource="simple">
SELECT Hospital.Hospital_name, Language.Language_name
FROM Language INNER JOIN LanuagesbyHospital INNER JOIN Hospital ON
LanuagesbyHospital.hospital_id = Hospital.Hospital_id ON Language.Language_id =
LanuagesbyHospital.language_id
WHERE Language.Language_name = 'English'
</cfquery>
<body>
<form name="form1" method="post" action="LanguagesbyHospitalresult.cfm">
<label>
<input type="submit" name="Submit" value="Submit">
</label>
<label>
<select name="select">
<option value="1">English</option>#Is this the correct way to label the
Option values - correspond to the language_id ?
<option value="2">Russian</option>
<option value="3">Spanish</option>
<option value="4">Portuguese</option>
<option value="5">Korean</option>
<option value="6">Chinese</option>
<option value="7">Tagalog</option>
</select>
</label>
</form>
</body>
</html>
I have got this working without any problems in Access.
Access
SELECT Hospital.Hospital_name, Language.Language_name
FROM [Language] INNER JOIN (LanuagesbyHospital INNER JOIN Hospital ON
LanuagesbyHospital.hospital_id = Hospital.Hospital_id) ON Language.Language_id
= LanuagesbyHospital.language_id
WHERE (((Language.Language_name)="English"));
quiero mas Guest
-
-
Dan Bracuk #5
Re: query tweaking
Could be that Language is a reserved word which shouldn't be used for a table
name. Change it to Languages and see if that helps.
By the way, that's a guess, I don't use MS Access myself.
Originally posted by: Scott*e
the error is?
id say it is on the line
Language ON Language.Language_id=LanguagesbyHospital.Language_ id, "Language"
the error being the text after the comma.
Dan Bracuk Guest
-
MikerRoo #6
Re: query tweaking
Yes, "Language" is a reserved word But not in Access.
It's a Coldfusion reserved word in queries. (Which 'splains why direct access
worked but CFM didn't.)
This brings up a good point for a beginner...
Get in the habit of using a naming style for everything you code.
For example, you might name all tables like this:
tLanguageList, tHospitalList, etc.
The "t" is a prefix that signifies that tLanguageList is a SQL table and not a
string, query or integer, etc.
-- MikeR
MikerRoo Guest
-
quiero mas #7
Re: query tweaking
Great you guys are the best - actually i cant believe how much other stuff i learn when i try and find out why somethings not going right - hope it comes in handy some day
Much appreciated
Mark
quiero mas Guest



Reply With Quote

