Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Treating negative numbers

Author  Topic 

pottspotts
Starting Member

9 Posts

Posted - 2007-11-04 : 21:17:07
Unfortunately I do not have the file in front of me. I have the the table and column 'sales.price' and I need the total number of this column listed on the report. I have a query which pulls these numbers based on 'consignment.date' and they include the positive and negative numbers.

In my sales report I try to list the total of this column, but it treats the negative numbers as positive numbers, and the total is inaccurate.

How do I fix this? The format of the negative numbers is '-12'

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-05 : 02:49:16
Please provide information about datatype for column.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-11-05 : 03:19:46
Also can you post the query you used?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

pottspotts
Starting Member

9 Posts

Posted - 2007-11-05 : 15:07:13
It is a linked file via Excel. In excel I have tried variations for storing, and it is currently 'general number'. It shows stored as 'number' in Access as well.

The SQL is:
Sum(Query1.amount) AS [Sum Of amount],


The report has:
=[Sum of Amount]*[payout]/100
Go to Top of Page

pottspotts
Starting Member

9 Posts

Posted - 2007-11-13 : 00:02:47
Does anyone have an answer on this?
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2007-11-13 : 00:03:59
try Sum(Query1.amount*1) as [Sum of Amount]

FYI, it is likely due to a first row of the range containing a text header. It isn't affected by the column type in Excel as one would think.



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page
   

- Advertisement -