deagon
Posts: 31
|
| Posted: 02/13/2007, 3:05 PM |
|
Have a small issue with outputing a simple label with a CCDLookup using SUM as a sort.
Here is the code.
Dim Conn
Dim tmp
set Conn = new clsDBJobstatus
Conn.Open
tmp = CCDLookup("SUM(orderValue)","Jobs","SalesRelease between '2007-01-01 00:00:00' and '2007-01-31 00:00:00' ",Conn)
Conn.Close
Set Conn = Nothing
It gives no errors however it does not display in simple lable with Before show added code.
Please help.....
|
 |
 |
Edd
Posts: 547
|
| Posted: 02/13/2007, 3:24 PM |
|
Your code looks fine. Some small things to ease your pain - use the ToSQL for dates.
Dim Conn
Dim tmp
Dim StartDate
Dim EndDate
StartDate = CDate('2007-01-01 00:00:00' )
EndDate = CDate('2007-01-31 00:00:00' )
set Conn = new clsDBJobstatus
Conn.Open
tmp = CCDLookup("SUM(orderValue)","Jobs","SalesRelease between " & Conn.ToSQL(StartDate, ccsDate) & " and " & Conn.ToSQL(EndDate , ccsDate) , Conn)
Conn.Close
Set Conn = Nothing
Verify the basics as they will always catch you when you are tired:
1. The there "tmp" is put into a label YourRecord.NameOfLabel.value = tmp
2. That the YourRecord.NameOfLabel.value data type and edit mask matches what you are trying to display, example text won't display in integer fields.
If that doesn't work you response.write to display what is in tmp - you should at least get zero?
Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
Tuong Do
|
| Posted: 02/21/2007, 6:41 PM |
|
Hi Deagon,
The lookup value has been assigned to variable tmp only
You need to assign the value of the variable tmp to your label
eg
label1.value = tmp
"deagon" <deagon@forum.codecharge> wrote in message
news:645d24439604f1@news.codecharge.com...
> Have a small issue with outputing a simple label with a CCDLookup using
> SUM as a
> sort.
>
> Here is the code.
>
> Dim Conn
> Dim tmp
> set Conn = new clsDBJobstatus
> Conn.Open
> tmp = CCDLookup("SUM(orderValue)","Jobs","SalesRelease between '2007-01-01
> 00:00:00' and '2007-01-31 00:00:00' ",Conn)
> Conn.Close
> Set Conn = Nothing
>
> It gives no errors however it does not display in simple lable with Before
> show
> added code.
>
>
> Please help.....
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Kleberson
|
| Posted: 02/22/2007, 1:02 AM |
|
It does not forget to place in the end of its code " Sender.Value = tmp "
Dim Conn
Dim tmp
set Conn = new clsDBJobstatus
Conn.Open
tmp = CCDLookup("SUM(orderValue)","Jobs","SalesRelease between '2007-01-01 00:00:00' and '2007-01-31 00:00:00' ",Conn)
Conn.Close
Set Conn = Nothing
Sender.Value = tmp
|
|
|
 |
Oper
Posts: 1195
|
| Posted: 02/25/2007, 6:15 AM |
|
one easy way to track error is goto your database manager , Access,MSSQL,MySQL,etc
and run the Query:
SELECT sum(ordervalue) FROM JOBS WHERE SaleRelease between '2007-01-01' AND '2007-01-31'
and check what happened (maybe a worng name or something)
http://www.GlobalDevelop.com
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
|