Convert a positive number to a negative number


This has to be a simple way to convert a positive number to a negative number. For example, convert 5 to -5. The field is quanitity and I wanted to convert to negative number. I tried to use negative = "-" & [quantity] but it doesn't work. Can someone help? Thanks a million!


Sponsored Links:



Greetings,

Searched the forum for a method to convert a Positive Number to a Negative Number based on the data in another field. Could not find anything.

I get data in Excel 97 which contains a field called DetailAmount. All of the numbers are positive.

Another field called TransactionType contains letters. The letter P indicates that the number in the DetailAmount field is a Negative number.

Q. Is there an expression in Access or Excel which will convert a Positive Number to a Negative Number so that the calculations will be accurate?

Thanks !!
(Using Office 97 at work)




I am a novice database builder only because I had to become one for work. So please bare with me in my lack of knowledge. I'm sure someone has run into this before so I'm hoping someone can help me out.

I am trying to convert a currency field from a positive number to a negative number, but the determinate on if it needs to change to a negative is based on the entry in another field. I have a field called DocBal and another field called DocType. If the DocType is "AD" then the DocBal value needs to be negative. If the DocType is anything else then the DocBal needs to stay positive.

I've tried an IIF statement, but it isn't working.

Any help would be greatly appreciated.

Thanks!




Does anyone have code that will convert a DEC number to and IP Address?




Help!!
I have 2 fields in a table one for a year and one for a week number that data is being collected against.
I need to change these to a month and year for the report. Is there a way to do this??




How do you write a procedure or function to convert a text file to a tabbed delimited file w/o using the wizard or a macro? Can this be done? I also need to trim the extra spaces from the fields in the text file. Thanks

I know I posted this in the macros section but I could not find an appropriate section that fit my question.




Hi,

I want to convert a Access application to SQL server 2005 application?
Do I have to convert all queries to stored procedure?

Thanks

Mark




Can I convert a access file to exe file?
I want to create a file for the users who don't know access.
It just likes an executable file.

I am using access 2007.

Thanks,




I have a field with amounts in it. For example:

Debit Amount:
00000006223
00000004356
0000000432r
0000000845v
00000006226
0000000198s
0000001638w
0000000911r
00000013667
0000000113q
00000001508

However, when the ‘Debit Amount’ has a letter as the last character,i need to replace the letter with a zero and make the whole number negative.

Anybody have any ideas?

I tried using the replace fuction but then would have to use it for every letter and then I dont know how to make it a negative.




I have a table with Yes/No fields. When I run my query it calculates the yes/no fields up to give a percentage. It shows it as a negative number. How do you format it for a positive number.




Is there a way to convert the date and time value returned by the Now() function into a whole number. I am attempting to group scans by a unique number. When the users clicks a "Save" button, I would like to save that unique number to a table. Each scan will be one record stored in a recordset until the user clicks Save. All of the records created in a recordset would have the unique number as a field. I want to include time to make sure the number is unique.

Another alternative would be to save a unique number to a table and read it each time the form is loaded. It would then be incremented each time the scans are saved.

I would like to see how the first option works before I decide. Does anyone have any suggestions?

Thank you.




Hi,
I have imported data from a csv file. One of the fields coming in is in a time / text format. Once I bring the data into the table, is there a query i can run to convert the text field to a number?

thanks,
P




Hi - what property do I need to set in order for a pos number to be changed to a neg # when entered. Example: User enters 10, once they tab off that field, it auto changes to a neg value.
thanks




hi,
I have dividing one int field by another and the results varies from 0 to 9999.999999999999

When I add a SUM(newnumber) into a group field in reports I get the error :
This expression is typed incorrectly, or it is too complex to be evaluated.

I think it might have something to do with the large decimal place.

from my query can I convert this number to 9999.99 at most ?
ie, only 2 decimal places..
Access should then beable to add the values,, correct ?


thank you for any help..




HI All

I am currently modifying a db for a user in access and am come accross two road blocks.

1.
I have included an extra (number)field in the db which allows the sorting of the db in the number order. What I want to do now and am finding difficult is: Every time the user adds a new record, the program must find the last record number and add 1 to this number. It must then assign this number to the extra field for the new record.


2. I initially displayed a datasheet view of the table to the user to allow editing and new additions, however because the table was linked to another table, it was causing poblems. I then decided to write a query to display the data. I now need to convert the month numbers to the month names in the query. Please throw me some ideas on how to go about this.

Thanx

Kind Regards




Currently in order to change my field from a positive number to a negative number I have to change the name of the field and multiply the old name by -1.

There has to be a quicker, easier, more efficient way to do this, Anyone?

Thanks

Mike




I have a form in which people enter the time it takes to do a particular job. Of course, it works just fine if they enter the number of minutes, but is there an easy way to convert a decimal number into minutes? For example, on the After Update event of the field, if they enter 3.5, it will convert that to 210. How do I go about doing such a thing?




I'm using Access 2003 and on an existing form I'm trying to convet a text box to a combo box.

I used the "Convert To" function by right clicking on the text box and selecting combo box. The control changed and looks fine.

I left the Control Source as it was and created a SQL in the Row Source with only one field. The SQL works fine and displays the list of values I want the combo box to display.

The bound column is 1, pointing to the only field in the SQL. The number of columns property is set to 1, as well. The Column Width property is set to the same with as the combo box.

Now for the part that's making be crazy. When I put the form into Form View the value from the Table displays, but if I open the combo box (dropdown) there is nothing in the list (the list area drops down, but is totally blank). I tried this with adding a new record with the same result.

I've created hundreds of combo boxes and never had this happen. I've compared the settings with working combo boxes on the same form and can find no relevant differences.

I am totally stumped. I know this has to be something stupid I'm overlooking, but I've got a total brain freeze about this problem.

If anyone can give me a suggestion of something I might have overlooked or something else to try (I've already tried creating a totally new combo box and got the exact same result (and this was even using the combo box wizard)).

TIA to anyone who responds with any helpful suggestions.

George




Hi,

I have a report that contains names, (each name in a row), I want to create a serial number for each name (i.e. 1, 2 , 3 , 4 ...)

Please note that these names are grouped in sections, I want in each section the serial starts from 1

Regards,
CS.




Hello everybody

I have a strange question;-)
I have an Access application and some word (docx) documents.
Now I want to "convert" the word documents to PDF.

One possibility is with automation like

	Code:
	Dim objWord As Object
Set objDoc = objWord.Documents.Open(filename:="test.docx")
objDoc.SaveAs filename:="test.pdf", FileFormat:=17
etc....

That works fine...on a local machine. Unfortunately I need to work on a Citrix environment, and that's bad. Very unstable.

Now my question:
is there a chance of converting test.docx into a pdf WITHOUT automation and withouth opening Word?
I thought there could be an Office library that I could use directly.

Perhaps it's not possible. Does anybody know something?
I also tried to find something with PDFCreator, but all examples are with the current document. But I dont' like to open the document.

Thank you very much!

Daniel