|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL Brain Fart
I feel like I am having a total brain fart. I am trying to use a select * where statement to get all the records from my database that match a given setup and using a URL variable:
Code: SELECT * FROM dbo.TerraLogMain WHERE Volume = '#URL.VolumeID#' Now I know for a fact that there are multiple records for Volume = Maps6 (for example) but I am only getting one record returned. It also looks like the URL variable is getting passed okay: Code: http://localhost/GISTerraLog/VolumeDetail.cfm?VolumeID=Maps6 I also tried using a direct statement just to see if that gave up any hints: SELECT * FROM dbo.TerraLogMain WHERE Volume = 'Maps6' but I still only get one record returned. So any clues as to what I am missing? Thanks for any help! Cheers, Melissa ![]() |
|
#2
|
||||
|
||||
|
love the thread subject
![]() try WHERE Volume like '%Maps6%' this might pinpoint problems with extraneous characters such as blanks in the data |
|
#3
|
|||
|
|||
|
That still returns only one record
![]() Does sql even look at or consider white spaces? I can't remember. How would I account for those when using a url variable like '#URL.VolumeID#'? That is what I actually need to pass as I have Maps1 throgh Maps10 in a list and I want the user to be able to click on each one and see the records associated with each. Thanks for your help!! melissa ![]() |
|
#4
|
||||
|
||||
|
more forensic querying...
what does this produce: Code:
select Volume
, count(*) as rows
from dbo.TerraLogMain
group
by Volume
|
|
#5
|
|||
|
|||
|
Um, sorry if this is a stupid question but where would I put the code you suggested? Would it replace the code I have which uses a URL variable sent from another page?
Thanks! (insert embarrassed smiley) melissa |
|
#6
|
||||
|
||||
|
Query Analyzer query window
at the moment it is advisable to put away the programming interface and talk directly to the database through a query window using plain SQL so that you can pinbpojnt your data problems |
|
#7
|
|||
|
|||
|
Oh how I wish I could. Unfortunately the main SQL guy (who has the password to our SQL Server) is out of town until next week so I'm just working in Dreamweaver with ColdFusion and some very basic SQL to create this little project log I am working on.
![]() I guess this one will just have to wait until next week. Thanks so much for your suggestions. You might just see me back here next week! melissa ![]() |
|
#8
|
|||
|
|||
|
wanted to delete this post but can't figure out how
|
|
#9
|
|||
|
|||
|
Well I just figured it out. And of course it really was a total brain fart . . .
I used just a regular old <cfoutput> when displaying my query items. As soon as I changed it to <cfoutput query="myqueryname"> it works! Thanks to r937 for trying to help me puzzle it out! melissa (insert forehead smacking smiley here) |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SQL Brain Fart |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|