Connecting to Progress using Asp.Net? Differences?

srelliott

New Member
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.

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>
 

Marian EDU

Member
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?

that has nothing to do with asp.net or whatever language you're using, your issue is the select statement that does not run on the client but on the database server... as with MS$SQL, MySQL, Oracle or any other database engine there might be reference documentation that you should use - http://documentation.progress.com/output/OpenEdge110/pdfs/dmsdv/dmsdv.pdf

GetDate => CURDATE
DATEPART => DAYOFMONTH, MONTH, YEAR, HOUR, MINUTE...
 

srelliott

New Member
Thanks for the reply. How is this looking?

SELECT SUM(Qty) as Total From Productionhistory WHERE Operation='MOLD 1' AND (Shift = case when TO_CHAR(CURTIME(), 'HH24:MM') < '06:30' then 3 when TO_CHAR(CURTIME(), 'HH24:MM') < '15:00' then 1 when TO_CHAR(CURTIME(), 'HH24:MM') < '23:30' then 2 else 3 end)

I still need to end it with adding a day if the time is between 11:30pm and 12:00am (since 3rd shift starts at 11:30pm and uses the next day for that 30 minutes), but I want to make sure I'm on the right track first and the rest of this select string is formatted correctly.
 

srelliott

New Member
I'm still having trouble getting this SQL SELECT string converted to a format that the Progress database will understand. Can anyone help me adjust it please? Maybe I was close (or maybe not?) in my last post...I just don't know enough about Progress to know. Thanks!
 
Top