Forums
This topic is locked
show all records, daft I know
Posted 09 Jul 2003 00:00:15
1
has voted
09 Jul 2003 00:00:15 derek webster posted:
this is probably staring me right in the face but how can I do this:I have a recordset showing when my id=(variable) - this brings back records that only have an id of that variable... but I want create a link at the top thats shows all records ie id=all...
how do I put this "if id=all then show all records" into my code?
hope this is clear.
thanks again
derek
Replies
Replied 13 Jul 2003 06:18:48
13 Jul 2003 06:18:48 Dan Berdusco replied:
Just create 2 recordsets. The first RS will call the record that is equal to the variable and the second RS will call all of the records.
Replied 15 Jul 2003 14:01:34
15 Jul 2003 14:01:34 derek webster replied:
Thanks for the reply - I had thought of this but thought it may be a rather clumsy or heavy way of doing it.
I would rather use some sort of IF ELSE statement with my existing record set - but I really don't know exactly how to do this
Thanks for your response tho - much appreciated
derek
I would rather use some sort of IF ELSE statement with my existing record set - but I really don't know exactly how to do this
Thanks for your response tho - much appreciated
derek
Replied 15 Jul 2003 15:55:37
15 Jul 2003 15:55:37 Vince Baker replied:
unfortunately sql cannot handle the logic of if, else then statements so you will have to do that part of the processing outside of the sql statement.
You could create two different select statements and call apon the one you want based on whether your variable is empty or not. However, make sure your recordset is correct as you will not be able to open it up in dreamweaver once you have made that sort of code change to it.
Regards
Vince
Visit my home: www.chez-vince.com
VBScript | ASP | HTML | SQL | Oracle | Hosting
You could create two different select statements and call apon the one you want based on whether your variable is empty or not. However, make sure your recordset is correct as you will not be able to open it up in dreamweaver once you have made that sort of code change to it.
Regards
Vince
Visit my home: www.chez-vince.com
VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 16 Jul 2003 13:52:37
16 Jul 2003 13:52:37 derek webster replied:
Thanks - I'll give it a go
derek
derek