how to calculate total of selected combo box items

558fe5180e0e8fc922d31c23ef84d240
If Me.cbobraketype.SelectedItem = ("Rim Brakes") Then
        braketype = ("Rim Brakes")
        price = "120"
        braketype = ("Rim Brakes")


    ElseIf Me.cbobraketype.SelectedItem = ("Disk Brakes") Then
        braketype = ("Disk Brakes")
        price = "150"
        braketype = ("Disk Brakes")



    End If

    'choose type of frame
    If Me.cboframetype.SelectedItem = ("Aluminium") Then
        frametype = ("Aluminium")

    End If

    'choose type of brakes
    If Me.cbobraketype.SelectedItem = ("Rim Brakes") Then
        braketype = ("Rim Brakes")
        price = "390"
        braketype = ("Rim Brakes")

    ElseIf Me.cbobraketype.SelectedItem = ("Disk Brakes") Then
        braketype = ("Disk Brakes")
        price = "430"
        braketype = ("Disk Brakes")

    End If

perform an operation on database using yesterday’s and today’s value

Category Image 101

I have a database where there is an table wm for water meters :

    +------+---------------+
    | Code |     name      |
    +------+---------------+
    | wm1  | water meter 1 |
    | wm2  | water meter 2 |
    | wm3  | water meter 3 |
    +------+---------------+

and another table counters where there are counters value :

    +------+---------+-------+------------+
    | Code | Code_wm | value | created_at |
    +------+---------+-------+------------+
    |    1 | wm1     |   100 | 2020-10-18 |
    |    2 | wm1     |   0   | 2020-10-19 |
    |    3 | wm2     |   0   | 2020-10-18 |
    |    4 | wm2     |   100 | 2020-10-19 |
    |    5 | wm3     |   0   | 2020-10-18 |
    |    6 | wm3     |   100 | 2020-10-19 |
    +------+---------+-------+------------+

i want get this result :

    | code_wm | result |   Date     |
    +---------+--------+------------+
    | wm1     | 0-100  | 2020-10-19 |
    | wm2     | 100-0  | 2020-10-19 |
    | wm3     | 100-0  | 2020-10-19 |
    +---------+--------+------------+

but when i try :

SELECT code_wm , LAG(value,1,0) OVER ( ORDER BY code_wm) as result
FROM counters 

i don't get the correct result : https://www.db-fiddle.com/f/7TuSTaukG336tqnTNDg4em/0