VS2005 Web Dev Express Bta2: Testing parameters in queries.

VS 2005 Web Dev Beta2 has a nice wizard for generating paramter driven queries. However, if you want to test a parameter against a value (rather than against a field), or even test for it being IS NULL/IS NOT NULL, neither the wizard nor the advanced query editor seem to be able to cope.

So, if I want to test a field against a parameter and test the same parameter for being NULL, what do I put in the query ? The example below (pmOrganisation and pmDateFrom are two parameters controls) shows what I want to achieve:

SELECT Organisation, DateIn, TranType
FROM Transactions
WHERE ( (Organisation = pmOrganisation) AND
((DateIn >= pmDateFrom) OR (pmDateFrom IS NULL)))

But the wizard seems only to be able to generate:

SELECT Organisation, DateIn, TranType
FROM Transactions
WHERE ((Organisation = ?) AND (DateIn >= ?))

So - surely there is a simple way of doing what I want done ?

Many thanks,

Kenneth Spencer

[954 byte] By [kaspencer] at [2007-12-16]

.NET Development

Site Classified