Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

solomon13000

@solomon13000
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Duplicate a record
    S solomon13000

    I managed to duplicate a single record. However I intended to display the duplicate record with different values. For example: A ABC 065 001 A10111 Sell 54.847500 0 0 T ABC 065 001 A10111 Sell 50.847500 0 1

    SELECT

    case i.ordStatus
    when 'Queued' then 'N'
    when 'Filled' then 'A'
    when 'Partial Filled' then 'A'
    when 'Cancel' then 'C'
    end AS 'ordStatus',

    f.code AS 'exchCode',
    g.code AS 'companyCode',
    h.code AS 'branchCode',
    c.code AS 'clientCode',
    i.transType AS 'transType',

    case i.ordStatus
    when 'Queued' then ((i.quantity * i.price * i.exchRate) / j.denomination)
    when 'Filled' then ((i.adjust * i.price * i.exchRate) / j.denomination)
    when 'Partial Filled' then ((i.adjust * i.price * i.exchRate) / j.denomination)
    when 'Cancel' then ((i.adjust * i.price * i.exchRate) / j.denomination)
    end AS 'ordAmount',

    case i.ordStatus
    when 'Queued' then 0
    when 'Filled' then 0
    when 'Partial Filled' then 0
    when 'Cancel' then 0
    end AS 'matchAmount'

    FROM TM_TradingProfile a
    LEFT JOIN TM_clientTradingProfile b
    ON a.id = b.id
    LEFT JOIN TM_Client c
    ON c.id = b.TM_client_fk
    LEFT JOIN BKL_User d
    ON d.id = c.id
    JOIN BKL_Authentication e
    ON c.id = e.BKL_user_fk
    LEFT JOIN RM_Exchange f
    ON a.RM_exchange_fk = f.id
    LEFT JOIN BKL_Company g
    ON a.BKL_company_fk = g.id
    LEFT JOIN BKL_Branch h
    ON a.BKL_branch_fk=h.id
    LEFT JOIN RM_MarketTransaction i
    ON a.tradingAccountNumber = i.tradingAccNo
    LEFT JOIN bkl_forexexch j
    ON i.tradCurr = j.currencyCodeFrom

    CROSS JOIN (SELECT 1 UNION ALL SELECT 1) AS T(x)

    WHERE a.tradingAccountNumber='ST3273'

    Besides, I should be able to display a duplicate record when the ordStatus is filled or partial filled. Your help is kindly appreciated. Thank You.

    Database help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups