Re: SQL Command for ranges
Dunno
Code:
select Amount
From SomeTable
Where (text1 >= [minimum]) AND (text1 <= [maximum])
Re: SQL Command for ranges
Welcome to VBForums :wave:
Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)
Re: SQL Command for ranges
Reply in SQL server you could use a case statement. I am not familiar enough with access to know if this syntax will work, but you could give it a try:
Code:
declare @input money; set @input = 555.00
select
case
when @input between 0.00 and 499.00 then 100.00
when @input between 500.00 and 599.00 then 200.00
when @input between 600.00 and 699.00 then 300.00
end
Re: SQL Command for ranges
pifft! No need for the select... the ranges are in a table, right?
Code:
SELECT * FROM tblRanges WHERE @Input BETWEEN MinField and MaxField
Of course replace @Input with what ever means to get your value into it.
-tg
Re: SQL Command for ranges
of course Technome is right. i created a table and tested it