StaticDOS Posted April 21, 2010 Share Posted April 21, 2010 Howdy gents in a report how do I increase a value to the next full number, e.g if I had a skirting board length 5.4m how do I get it to be 6m in a report, I know in a normal report you put =ceiling and then ,1 in your formula but it doesnt seem to be working in my VW report. Quote Link to comment
michaelk Posted April 21, 2010 Share Posted April 21, 2010 Use the INTEGER function. INT(#) returns just the integer part of the number. Then you just add 1. But first you need to compare the number to INT(number) to make sure they aren't the same and only use int(#)+1 when you need it... Hope that makes sense. Anyway this formula in a worksheet database should work: =IF((LENGTH=INT(LENGTH)), LENGTH, INT(LENGTH)+1) hth michaelk Quote Link to comment
Pat Stanford Posted April 21, 2010 Share Posted April 21, 2010 Or you can avoid the If function. =(Length Div 1) + Round((Length Mod 1) + 0.5) Div gives you the integer part. Mod gives you the fraction. Round of the fraction + 0.5 gives you an integer of 0 or 1 to add to the integer part. Quote Link to comment
michaelk Posted April 21, 2010 Share Posted April 21, 2010 Very cool, Pat. Where did you find Div and Mod? They don't appear in the list of worksheet database functions or VW help. Quote Link to comment
Pat Stanford Posted April 21, 2010 Share Posted April 21, 2010 They are in the Vectorscript documentation. Check out the Vectorscript Language Guide, Expressions, Arithmetic Operators. The others are the usual, +, -, *, / for add, subtract, multiply and divide. ^ is used for exponentiation. While you are there you probably want to chek out the Comparison and Logical Operators also. Quote Link to comment
StaticDOS Posted April 22, 2010 Author Share Posted April 22, 2010 What formulas do I put into a database header so I will be allowed to write random text in the rows below, When there is no formula in row 2 for example rows 2.1, 2.2, 2.3 etc. are locked and dont allow me to enter any text? Quote Link to comment
Pat Stanford Posted April 22, 2010 Share Posted April 22, 2010 All the cells in a database must be connected to a record field if you want to do data entry. If you only want a formula in the cell it does not have to have a field. If this is for something like a door, there are fields in the PIO labeled something like User Field 1 to User Field 10. In this case the formula would be ='Door'.'UserFld1'. If this is for objects that don't have user fields, you will need to create a record (let's call it MyRecord) with a field (MyTextField1). Make sure the field is defined as a Text field if you want to do random characters. Attach the new record format to every object (via the Data tab of the Object Info Palette) that you want to be able to enter the text for. The formula will then be: ='MyRecord'.'MyTextField1' Feel free to substitute whatever record and field names you want. If you have spaces in the names you will need to include the quote marks. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.