Expand|Select|Wrap|Line Numbers
- Bldg____Electric_____Gas___Heat____Cool____Water___Sewer
- BLDG1___79E+231E_____40G___1H______1C______86W_____111S
- BLDG2___80E+232E_____39G___NULL____NULL____3W+2W___163S
- BLDG3___71E-72E+316E_168G__9H______20C+48C_77W_____138S
- BLDG4___332E_________187G__53H-52H_50C-49C_162W____183S
- **Notice how in bldg3 electric, it's 71E-72E+316E.
I am trying to find the total cost for each building every month, by creating a query and doing some VBA, but nothing is working right now. I've been working with just the electric meters to try to get something to work, and I found this function
Expand|Select|Wrap|Line Numbers
- Public Function SplitMeters(sPackedValue As Variant, nPos As Long)
- Dim sElements() As StringsElements() = Split(Nz(sPackedValue, ""), "E")
- If UBound(sElements) < nPos Then
- SplitMeters = ""
- Else
- SplitMeters = sElements(nPos)
- End If
- End Function
Expand|Select|Wrap|Line Numbers
- BLDG___METER1___METER2___METER3
- BLDG1__79_______+231_____NULL__
- BLDG2__80_______+232_____NULL__
- BLDG3__71_______-72______+316__
- BLDG4__332______NULL_____NULL__
My idea right now is get all the meters in one field and have the building name repeat, then try to join on meter number and have another field with cost besides that, and then grab all the costs for each building to find the total. However I can't find a way to do this, so I am open to any ideas, especially regarding how to handle the plus and minus signs in the data. I know the data is in horrible shape, and that is a big part of why they have me replacing the old program. I'm just trying to cleanup the best I can. Thank you for all the help and please ask any questions you have!