I have some SELECT strings that work fine in asp.net when connecting to an SQL database, but I can't get them to connect to the Progress database and perform these tasks to display info without errors. Do I just need to change some of the commands in the SELECT string (are some just not recognized by the progress database, even though I'm doing it inside an asp.net page)? Will asp.net still recognize them if I change GetDate() to Cur_Date()...or whatever the progress equivalent is?
Here's what I have in my .aspx page...I just need help adjusting it to work. NOTE: If I make it a very simple string, it does connect and display simple data, so it's linked up ok...I'm just running into trouble when I try all of the GetDate(), DATEPART, CONVERT...etc.
Here's what I have in my .aspx page...I just need help adjusting it to work. NOTE: If I make it a very simple string, it does connect and display simple data, so it's linked up ok...I'm just running into trouble when I try all of the GetDate(), DATEPART, CONVERT...etc.
Code:
<asp:SqlDataSource
ID="SqlDataSource1"
Runat="server"
SelectCommand="SELECT SUM(Qty) as Total From Productionhistory WHERE Operation='MOLD 1' AND (Shift = case when CONVERT(char(8), GetDate(), 8) < '06:30' then 3 when DATEPART(hour, GetDate()) < 15 then 1 when CONVERT(char(8), GetDate(), 8) < '23:30' then 2 else 3 end) AND (Date = case when CONVERT(char(8), GetDate(), 8) >= '23:30' then convert(varchar(10),DATEADD(day,1,GetDate()),101) else convert(varchar(10),getdate(),101) end)"
ConnectionString="<%$ ConnectionStrings:SomeConnectionInfo %>"
ProviderName="<%$ ConnectionStrings:SomeConnectionInfo.ProviderName %>" >
</asp:SqlDataSource>