E
Eddy
Hello,
up until i started using Stored procedures, i had no problems whatsoever
passing date parameters (27/09/2003) as string ('20030927') to sql
server. (I do not use an ADP but do everything through Pass Through
queries).
a query that is performing perfectly well in Query Analyser does not
return the desired results when i fire it through a Stored procedure:
CREATE PROCEDURE procBeschikbareRondleidingen @Mnd int, @LocID int,
@LftID int, @DtBz datetime
AS
SELECT DISTINCT tb_Rondleidingen.ID_Locatie, ..... , LokaalBezet =
case
when tb_rondleidingen.id_rondleiding IN
(Select r.id_rondleiding from tb_Lokaalbezetting q,
tb_XRolFac r where r.id_Faciliteit = q.id_faciliteit
and datumbezoek = convert(char(8), @DtBz ,112)) then 1
when tb_rondleidingen.id_rondleiding NOT IN
(Select r.id_rondleiding from tb_Lokaalbezetting q,
Tb_XRolFac r where r.id_Faciliteit = q.id_faciliteit
and datumbezoek = convert(char(8), @DtBz ,112)) then 0
end
FROM .... etc...
The MsAccess side:
DtBezet = Format(Me.DatumBezoek, "mm/dd/yyyy")
cmd.Parameters("@DtBz") = DtBezet
Whatever combination i try, the stored proc always wants a datevalue - i
have tried all possible flavours of date format.
I run the results in a temporary Access table rst!LokaalBezet in a
Yes/NO field - all fields stay 0...
i would defenitly appreciate some help on this issue as my already gray
hairs will become even more gray....
thanks
eddy galle
up until i started using Stored procedures, i had no problems whatsoever
passing date parameters (27/09/2003) as string ('20030927') to sql
server. (I do not use an ADP but do everything through Pass Through
queries).
a query that is performing perfectly well in Query Analyser does not
return the desired results when i fire it through a Stored procedure:
CREATE PROCEDURE procBeschikbareRondleidingen @Mnd int, @LocID int,
@LftID int, @DtBz datetime
AS
SELECT DISTINCT tb_Rondleidingen.ID_Locatie, ..... , LokaalBezet =
case
when tb_rondleidingen.id_rondleiding IN
(Select r.id_rondleiding from tb_Lokaalbezetting q,
tb_XRolFac r where r.id_Faciliteit = q.id_faciliteit
and datumbezoek = convert(char(8), @DtBz ,112)) then 1
when tb_rondleidingen.id_rondleiding NOT IN
(Select r.id_rondleiding from tb_Lokaalbezetting q,
Tb_XRolFac r where r.id_Faciliteit = q.id_faciliteit
and datumbezoek = convert(char(8), @DtBz ,112)) then 0
end
FROM .... etc...
The MsAccess side:
DtBezet = Format(Me.DatumBezoek, "mm/dd/yyyy")
cmd.Parameters("@DtBz") = DtBezet
Whatever combination i try, the stored proc always wants a datevalue - i
have tried all possible flavours of date format.
I run the results in a temporary Access table rst!LokaalBezet in a
Yes/NO field - all fields stay 0...
i would defenitly appreciate some help on this issue as my already gray
hairs will become even more gray....
thanks
eddy galle