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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Query for this pricing model

Query for this pricing model

Scheduled Pinned Locked Moved Database
databasesaleshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ChrisFarrugia
    wrote on last edited by
    #1

    Dear All, I am implementing a shopping where the prices of the products are structured according to the quantity taken for examle: 1 = 1 Euro 3 = 0.80Euro 5 = 0.70 Euro etc etc The database is structured as follows: quantity1 pricequantity1 quantity2 pricequantity2 quantity3 pricequantity3 etc A quantity and pricequantity can be set to 0 if no further quantity groups exist. I need a query where I pass a quantity and it gets the subtotal. Can someone help please? Thanks Chris

    C 1 Reply Last reply
    0
    • C ChrisFarrugia

      Dear All, I am implementing a shopping where the prices of the products are structured according to the quantity taken for examle: 1 = 1 Euro 3 = 0.80Euro 5 = 0.70 Euro etc etc The database is structured as follows: quantity1 pricequantity1 quantity2 pricequantity2 quantity3 pricequantity3 etc A quantity and pricequantity can be set to 0 if no further quantity groups exist. I need a query where I pass a quantity and it gets the subtotal. Can someone help please? Thanks Chris

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I guess you can put a case statement in your select.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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