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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sql calc & syntax

Author  Topic 

NTC
Starting Member

21 Posts

Posted - 2006-03-14 : 21:42:01
am wrestling w/ a calc and syntax:

in Form1 user selects a value 500 from Listbox1

Existing Table1:

Loc Ref Quant Series

A 1 1350 1350
B 1 1000 2350
C 1 400 2750
C 2 350 350
D 2 600 950

-------
in plain english - above table1 Series runs sequencially for Ref 1 across multiple Locs and resets when there is a new Ref 2....this table is in place.

needed query result based upon the 500 selected value (which next user might select a different value) - the needed Boxed value can only increment in the selected value (i.e. 500) but not exceed the Series level.

Query Result:

Loc Ref Quant Series Boxed(this value from form)

A 1 1350 1350 500
A 1 1350 1350 1000
A 1 1350 1350 1350
B 1 1000 2350 1850
B 1 1000 2350 2350
C 1 400 2750 2750
C 2 350 350 350
D 2 600 950 850
D 2 600 950 950
--
I have the query built so it will accurately re-duplicate all the needed repeated records - it is only the Boxed column values that are missing; I've typed in what the values should be and am wrestling with the math/syntax/sql for the Boxed
calculation column....and bringing in that value (500 in this case) from the form as part of the calc......

much thanks to those further into sql than I am at this point to help on this.
   

- Advertisement -