pixiecrinkle: (modigliani)
[personal profile] pixiecrinkle
Because I'm far from it.

I am such a geek, however, that I have an Access database that I use to catalog all of my yarn inventory. Seeing as how I'm trying to get into the business of design and consignment, I need to keep better track of my materials cost. So I'm setting up an access report that shows me how much I've got in a given yarn on hand.

I'm trying to set up a formula that would multiply the number of balls x price per ball. However, if I have less than a full ball, I still want to count it as a full ball for these purposes (seeing as how I can't just walk in and buy a half ball of yarn).

I know that what I'd do in Java: math.ceiling(number of balls) * cost per ball. But I can't seem to find a ceiling function in Access, and I've had no luck googling to find it. The Round() function isn't cutting it, because it's rounding down (even for .5, which is odd to me).

Help???

Date: 2005-10-09 03:19 am (UTC)
ext_67746: (Elderly Buster)
From: [identity profile] laughingrat.livejournal.com
I know that what I'd do in Java: math.ceiling(number of balls) * cost per ball. But I can't seem to find a ceiling function in Access, and I've had no luck googling to find it. The Round() function isn't cutting it, because it's rounding down (even for .5, which is odd to me).

*nods sagely*

*runs shrieking*

Date: 2005-10-09 03:21 am (UTC)
From: [identity profile] chaptal.livejournal.com
"Help???"

I'd say you need it, yes ;)

Date: 2005-10-09 04:52 pm (UTC)
From: [identity profile] luminesque.livejournal.com
I'm by no means an expert, but all my database work has been in Access. I'm too lazy right now to open one of them and check, but try ROUNDUP instead of ROUND.

Date: 2005-10-11 03:57 am (UTC)
From: [identity profile] backinohio.livejournal.com
Screw the built in functionality when a hack would just as well is what i always say. Compute the remaineder of division, then add an if/then statement. If != 0 (or some threshold say if you could squeeze one ball into 1.01 called for balls), then it's the bigger number.

Date: 2005-10-11 04:00 am (UTC)
From: [identity profile] backinohio.livejournal.com
oh, you were looking for access experts... but still, a good hack is like a homecooked meal. it has the love that some microserf would never include.

Date: 2005-10-11 03:13 pm (UTC)
From: [identity profile] pixiecrinkle.livejournal.com
I didn't think of doing it that way. I did end up hacking it, but in a different way altogether.

I found a function that would convert a decimal to an integer, and as long as it was negative, it would do it in the way I wanted. So I ended up doing this:

Abs(Int(0-numBalls)) * costPerBall

instead of the easier

ceiling(numBalls)*costPerBall.


Sheesh.

Profile

pixiecrinkle: (Default)
pixiecrinkle

July 2009

S M T W T F S
   1234
567 891011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 17th, 2026 07:44 pm
Powered by Dreamwidth Studios