Page 1 of 1

Datetime parameter problem

Posted: Sat 02 Apr 2011 18:50
by MWKZ
Hi,

I use SDAC TMSQuery to retrieve some date from SQL Server express 2005 SP2 server.

The following SQL Query is used


SELECT
[AccountNo]
,[CurrencyCode]
,[FirstName]
,[LastName]
,[Description]
,SUM([Credit]) AS Credit
,SUM([Debit]) AS Debit
,SUM([CreditUsingDefaultCurrency]) AS CreditUsingDefaultCurrency
,SUM([DebitUsingDefaultCurrency]) AS DebitUsingDefaultCurrency
,SUM([Debit] - [Credit]) AS Balance
,SUM([DebitUsingDefaultCurrency] - [CreditUsingDefaultCurrency]) AS BalanceUsingDefaultCurrency
, YEAR(NoteDate) AS Year
FROM [ReportAccountsTransactions]
WHERE ((:AllAccounts = 1) OR (AccountNo BETWEEN :FromAccount AND :ToAccount)) AND
((:AllDates = 1) OR (NoteDate BETWEEN :FromDate AND :ToDate))
GROUP BY [FirstName], [LastName], [AccountNo], [CurrencyCode], [Description], YEAR(NoteDate)
ORDER BY YEAR(NoteDate), AccountNo


The problem is that when I open the query after setting the parameters values, SDAC sends the date parameters values increased by one day.

Is it a normal behavior or I am missing something?

Thank You

Posted: Mon 04 Apr 2011 07:48
by AndreyZ
Hello,

I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create and fill a table. Also please specify the following:
- the exact version of SDAC. You can learn it from the About sheet of TMSConnection Editor;
- the exact version of your IDE.

Posted: Tue 05 Apr 2011 08:13
by MWKZ
Hi,

Thank you for your help.

I upgraded to the latest version and the problem is now solved. I was using SDAC version 4.2 with Delphi 2007.

Posted: Tue 05 Apr 2011 08:34
by AndreyZ
It is good to see that this problem was solved. If any other questions come up, please contact us.