B
Benjamin Pratt
am having a problem with an ADO query. The SELECT portion of the
query is:
SELECT ID, true AS Achieved, DateAchieved, Prompt
Here, I am creating a calculated field where the value is always true. The
problem is when the result set is returned, the 'Achieved' data type is
defined as
ShortInt by ADO. I need it to be Boolean.
Is there some way I can explicitly define the datatype in the select
statement?
Something like:
SELECT ID, BOOLEAN(true) AS Achieved, DateAchieved, Prompt
I am using BCB6 & Jet4.0. The entire query is below.
SELECT ID, true AS Achieved, DateAchieved, Prompt
FROM ACHIEVEMENTS, BENCHMARKS
WHERE ID = BenchmarkID
AND LanguageID = :LanguageID
AND CategoryID=:CategoryID
AND LevelID=:LevelID
AND ID In (SELECT BenchmarkID FROM BENCHMARK_GRADES WHERE Grade = :Grade)
AND StudentID = :StudentID
UNION
SELECT ID, false AS Achieved, Null AS DateAchieved, Prompt
FROM BENCHMARKS
WHERE ID NOT IN (SELECT BenchmarkID FROM ACHIEVEMENTS WHERE StudentID =
:StudentID)
AND LanguageID=:LanguageID
AND CategoryID=:CategoryID
AND LevelID=:LevelID
AND ID In (SELECT BenchmarkID FROM BENCHMARK_GRADES WHERE Grade = :Grade)
ORDER BY ID
query is:
SELECT ID, true AS Achieved, DateAchieved, Prompt
Here, I am creating a calculated field where the value is always true. The
problem is when the result set is returned, the 'Achieved' data type is
defined as
ShortInt by ADO. I need it to be Boolean.
Is there some way I can explicitly define the datatype in the select
statement?
Something like:
SELECT ID, BOOLEAN(true) AS Achieved, DateAchieved, Prompt
I am using BCB6 & Jet4.0. The entire query is below.
SELECT ID, true AS Achieved, DateAchieved, Prompt
FROM ACHIEVEMENTS, BENCHMARKS
WHERE ID = BenchmarkID
AND LanguageID = :LanguageID
AND CategoryID=:CategoryID
AND LevelID=:LevelID
AND ID In (SELECT BenchmarkID FROM BENCHMARK_GRADES WHERE Grade = :Grade)
AND StudentID = :StudentID
UNION
SELECT ID, false AS Achieved, Null AS DateAchieved, Prompt
FROM BENCHMARKS
WHERE ID NOT IN (SELECT BenchmarkID FROM ACHIEVEMENTS WHERE StudentID =
:StudentID)
AND LanguageID=:LanguageID
AND CategoryID=:CategoryID
AND LevelID=:LevelID
AND ID In (SELECT BenchmarkID FROM BENCHMARK_GRADES WHERE Grade = :Grade)
ORDER BY ID