deagon
Posts: 31
|
| Posted: 02/13/2007, 7:54 AM |
|
This is most likely simple for most of you code charge folks out there. For me its really been a pain, I'm a IT person pushed into the role of writing ASP code for a front end for our SQL database. Its been ok just trying to do the best without very little back round in this type of code. Here it goes, I want to pull out data from my SQL database and use the function code in code charge like CCDLookup. The data needs to be month and the sum needs to be passed to a label. The code is
SELECT SUM(ordervalue) from jobs where salesrelease between '01-01-2007' and '01-31-2007'
It works in SQL but I can't find a proper way to do it with code charge. Can anyone help, I'm running out of time and patients.
|
 |
 |
Benjamin Krajmalnik
|
| Posted: 02/13/2007, 4:31 PM |
|
In the labels BeforeShow event add the following:
EventCaller.Value = CCDLookup("SUM(ordervalue)", "jobs", "salesrelease
between '01-01-2007' and '01-31-2007'", DBYourConnectionName)
Now, since I assume that the date ranges are passed parameters, you coud do
the following:
This assumes that you are passing the start date and end date on the URL as
startdate=whatever&enddate=whatever
In the BeforeSHow event
Dim MyWhereClause, MyStartDate, MyEndDate
MyStartDate = CCGetParam("startdate", "")
MyEndDate = CCGetParam("enddate", "")
If MyStartdate <> "" and MyEndDate <> "" then
MyWhereClause = "salesrelease between " &CCToSQL(MyStartDate, "text") &
" and " & CCToSQL(MyEndDate, "text")
EventCaller.Value = CCDLookup("SUM(ordervalue)", "jobs", MyWhereClause",
DBYourConnectionName)
End If
"deagon" <deagon@forum.codecharge> wrote in message
news:645d1df49b0e42@news.codecharge.com...
> This is most likely simple for most of you code charge folks out there.
> For me
> its really been a pain, I'm a IT person pushed into the role of writing
> ASP
> code for a front end for our SQL database. Its been ok just trying to do
> the
> best without very little back round in this type of code. Here it goes, I
> want
> to pull out data from my SQL database and use the function code in code
> charge
> like CCDLookup. The data needs to be month and the sum needs to be passed
> to a
> label. The code is
>
> SELECT ordervalue from jobs where salesrelease between '01-01-2007' and
> '01-31-2007'
>
> It works in SQL but I can't find a proper way to do it with code charge.
> Can
> anyone help, I'm running out of time and patients.
>
> 
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|