Datetime parameter problem

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MWKZ
Posts: 2
Joined: Sat 02 Apr 2011 18:38
Location: Beirut

Datetime parameter problem

Post by MWKZ » Sat 02 Apr 2011 18:50

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

AndreyZ

Post by AndreyZ » Mon 04 Apr 2011 07:48

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.

MWKZ
Posts: 2
Joined: Sat 02 Apr 2011 18:38
Location: Beirut

Post by MWKZ » Tue 05 Apr 2011 08:13

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.

AndreyZ

Post by AndreyZ » Tue 05 Apr 2011 08:34

It is good to see that this problem was solved. If any other questions come up, please contact us.

Post Reply