Results 1 to 2 of 2

Thread: [Noob] Need help on Lazarus-SQL

  1. #1
    Join Date
    Apr 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [Noob] Need help on Lazarus-SQL

    Hello everyone, right now i'm trying to practice some lazarus-mysql programming, and i have some questions, can i filter the conditions
    For example, like from this table

    | Size | Deviation |

    1.| 80 | 30 |
    2.| 100 | 40 |

    (Sorry for the crude table)

    I need to calculate the ones with size 80 in this way:
    if the size is 80 and deviation <= 10, then result = (deviation)*1000), otherwise
    if deviation <=20 then result = (deviation-10)*2000 + 10*1000.
    and
    if deviation >=21 then result = (deviation-20)*3000 + 10*2000 +10*1000

    And if the size is 100, it will be:
    if the size is 100 and deviation <= 10, then result = (deviation)*2000, otherwise
    if deviation <=20 then result = (deviation-10)*3000 + 10*2000
    and
    if deviation >=21 then result = (deviation-20)*4000 + 10*3000 +10*2000

    How can i make lazarus to be able to do this?
    I can do this on freepascal and without the datas from sql
    but on this, i'm very confused
    I am really confused right now

    I'm using win7 x64 and lazarus 0.9.30 and FPC 2.6.0

    Thanks in advance
    Regards, malvinvnv

  2. #2
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Have you read through this:

    http://wiki.freepascal.org/MySQLDatabases

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •