Hello,
I was using this code which was workign well:
conn2Query="SELECT TOP "&PeriodNb&" Name,MAINKEY FROM PDM_PERIODS_3 WHERE (PDM_PERIODS_3.Hidden=0 AND GetDate()>BreakDate) AND MAINKEY NOT IN (SELECT TOP "&StartingPeriod&" MAINKEY FROM PDM_PERIODS_3 WHERE (PDM_PERIODS_3.Hidden=0 AND GetDate()>BreakDate AND BeginDate>'1.1.2001') ORDER BY BreakDate DESC) ORDER BY BreakDate DESC"
I wanted to add a variable in my config file, like that:
JoinDate="1.1.2001"
And then use this variable in my previous code query/line
conn2Query="SELECT TOP "&PeriodNb&" Name,MAINKEY FROM PDM_PERIODS_3 WHERE (PDM_PERIODS_3.Hidden=0 AND GetDate()>BreakDate) AND MAINKEY NOT IN (SELECT TOP "&StartingPeriod&" MAINKEY FROM PDM_PERIODS_3 WHERE (PDM_PERIODS_3.Hidden=0 AND GetDate()>BreakDate AND BeginDate>'"&JoinDate&"') ORDER BY BreakDate DESC) ORDER BY BreakDate DESC"
But now, I get an error...
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E07)
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
I really cannot see any difference between both lines
I really hope, that someone will!
Thanks in advance
Coume