Groups | Blog | Home
all groups > sql server reporting services > march 2006 >

sql server reporting services : Condition on a field date in a query data set


Pasquale
3/1/2006 9:01:29 AM
I need to extraxt from a table of my db the records that satisfy a condition
on a field date.
I use this query string for the data set:
="SELECT Cliente, NrDocumento, DataDocumento, NrRegistrazione,
DataRegistrazione, TipoDocumento, Descrizione, DataScadenza, Importo,
ImportoIncassato FROM Partitario WHERE (Azienda = " & "'" &
Parameters!Azienda.Value & "') AND (Cliente = " & "'" &
Parameters!Cliente.Value & "') AND (Importo - ImportoIncassato > 0) AND
(DataScadenza<=" & Format(Globals!ExecutionTime,"d") & ")"

In my table Partitario exists a record with datascadenza < actual date
calculated by Globals!ExecutionTime: but this query doesn't extract nothing!
Is the syntax right?

How can I solve this issue?

Craig
3/2/2006 12:00:00 AM
Use a datediff instead of a <= comparison.

Craig

[quoted text, click to view]

Pasquale
3/2/2006 12:50:28 AM
Or use GETDATE() in SQL query string.

Many thanks

[quoted text, click to view]
AddThis Social Bookmark Button