SQL Against MS Access

  • Thread starter Thread starter C_Silin
  • Start date Start date
C

C_Silin

Hello, I have a problem with getting the proper results back when I
supply a "Guid" value in the where clause. If I run this query without
the specifying the Guid value, I get back 3 rows, all of them with the
same value in the "Guid" field. This is the same field that I am
attepting to place selection criteria on.

So now if I now change the query to specify that Guid number (returned
from the query mentioned above), I get back no rows. I am completely
baffled why this is.

Here is my query...

"SELECT count(*)
FROM SkatingClubs sc, Skater s, SkatingLevels sl, Bracket b, Events e,
CompetativeEvents ce, CompetitionDescription cd , EventFinals ef
where sl.SkatingLevelNbr = S.SkatingLevelNbr
and sc.ClubID = s.ClubID
and s.USFSA_ID = ef.USFSA_ID
and ef.EventID = e.EventID
and b.Bracket = e.Bracket
and ce.CompetitionLocationID = e.CompetitionLocationID
and cd.CompetitionDescriptionID = e.CompetitionDescriptionID"

the above works just fine, now if I add the following:
and ce.CompetitionLocationID = '7E0FEA53-4BC1-47E6-96CD-8DD0747FCEE2'


And that Guid is the guid which is in the records returned by the first
version of the query. I can run this same query against a SQL database
with the exact same data in the tables and it runs just fine.

So what can it be?

Thanks in advance for your assistance!!!!!!!!!!!!!!!!!!!!!
 
¤ Hello, I have a problem with getting the proper results back when I
¤ supply a "Guid" value in the where clause. If I run this query without
¤ the specifying the Guid value, I get back 3 rows, all of them with the
¤ same value in the "Guid" field. This is the same field that I am
¤ attepting to place selection criteria on.
¤
¤ So now if I now change the query to specify that Guid number (returned
¤ from the query mentioned above), I get back no rows. I am completely
¤ baffled why this is.
¤
¤ Here is my query...
¤
¤ "SELECT count(*)
¤ FROM SkatingClubs sc, Skater s, SkatingLevels sl, Bracket b, Events e,
¤ CompetativeEvents ce, CompetitionDescription cd , EventFinals ef
¤ where sl.SkatingLevelNbr = S.SkatingLevelNbr
¤ and sc.ClubID = s.ClubID
¤ and s.USFSA_ID = ef.USFSA_ID
¤ and ef.EventID = e.EventID
¤ and b.Bracket = e.Bracket
¤ and ce.CompetitionLocationID = e.CompetitionLocationID
¤ and cd.CompetitionDescriptionID = e.CompetitionDescriptionID"
¤
¤ the above works just fine, now if I add the following:
¤ and ce.CompetitionLocationID = '7E0FEA53-4BC1-47E6-96CD-8DD0747FCEE2'
¤
¤
¤ And that Guid is the guid which is in the records returned by the first
¤ version of the query. I can run this same query against a SQL database
¤ with the exact same data in the tables and it runs just fine.
¤
¤ So what can it be?
¤
¤ Thanks in advance for your assistance!!!!!!!!!!!!!!!!!!!!!

I believe the guid format in your criteria statement should look something like this:

ce.CompetitionLocationID={guid {7E0FEA53-4BC1-47E6-96CD-8DD0747FCEE2}}


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top