Results 1 to 19 of 19

Thread: Sql

  1. #1
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default Sql

    Who knows SQL and can help me?

    I am running a program that tracks fleet vehicles, part of it is billing that uses SQL. I need to show a tax component in my invoices that has the GST included amount. So what I need to do is have a field that shows a figure of 9.09% of another field. I know where the SQL function needs to go, but I am having difficulty in writing the correct function so it works.
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  2. #2
    Ride
    1995 HSV Clubsport T5, 1991 VN Berlina

    Join Date
    Jun 2005
    Location
    Melbourne
    Posts
    5,037

    Default

    Well at the moment I'm writing Java and SQL programs that deal with electricity meter billing. Perhaps i could help.

    What are you writing the program in?

    1995 Manual HSV Clubsport
    Wade Cam :: 9.2:1 CR :: Pacemaker headers :: Twin 2.5" Exhaust :: VT Brakes
    1991 Supercharged VN Berlina
    9 PSI SC14 Intercooled :: Genie headers :: Twin cats :: HM Twin 2.25 exhaust :: 3.45:1 LSD




  3. #3
    VN_Luke's Avatar
    VN_Luke is offline ƃuoɹʍ ʇsnɾ sı sıɥʇ
    Ride
    VT, RB30EST VN

    Join Date
    Mar 2005
    Posts
    1,512

    Default

    SELECT <<price_col>> * X as `gst`, <<price_col>> as `price` FROM <<whatever table>>

    price_col is the name of the colum that contains your price......
    X is the number by which you want to multiply the price in order to get the GST value
    whatever table is the name of the table you're getting this data from

  4. #4
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    It's not really a table that i need to get the information from. It is SQL embedded in the program I think. Here is a screen shot of the SQL part and the bit i need to change.
    Attached Thumbnails Attached Thumbnails Sql-sql-statement.jpg  
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  5. #5
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    The txtTax is the bit that the operation in the lower pane describes, at the moment it just reads $0.00. what I need to do is make it show a value calculated from another field. The other field name is DBText15.
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  6. #6
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    I don't think that would work anyway, because I need to calculate the value from another field in the same document. You need to see the program I think to see how it works.

    If anyone wants to download the trial version and look at it, it's called Fleet Maintenance Pro.
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  7. #7
    Ride
    1995 HSV Clubsport T5, 1991 VN Berlina

    Join Date
    Jun 2005
    Location
    Melbourne
    Posts
    5,037

    Default

    still want help with this? downloaded that program but have no idea how to get to the screen in the picture above

    1995 Manual HSV Clubsport
    Wade Cam :: 9.2:1 CR :: Pacemaker headers :: Twin 2.5" Exhaust :: VT Brakes
    1991 Supercharged VN Berlina
    9 PSI SC14 Intercooled :: Genie headers :: Twin cats :: HM Twin 2.25 exhaust :: 3.45:1 LSD




  8. #8
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    You need to create an invoice first.

    On the tool bar there is 'Billing', click that, then 'generate invoice'. Click the 'misc items' tab and click add. Type something there and put in a price, doesn't matter what. Make the quantity 1. Then click save. There is a check box that says print upon saving, check that and click save. A 'Report Filtering Options' screen appears, click the 'customize' button bottom left. It will bring up the 'Maintenance Report Designer'. Top left is a 'calc' tab, click that. On the menu in the left pane, scroll down until you see 'txtTax', it will be highlighted in green, that shows that there are event handlers for that option. Click on it and in the right pane will appear the 'OnGetText' with a green page next to it, click that and you will see the SQL statement.

    Bit of messing around I know.
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  9. #9
    Ride
    A Pushie

    Join Date
    Mar 2006
    Location
    Cronulla, NSW
    Posts
    228

    Default

    Quote Originally Posted by Not_An_Abba_Fan View Post
    It's not really a table that i need to get the information from. It is SQL embedded in the program I think. Here is a screen shot of the SQL part and the bit i need to change.
    Thats not sql.

    Whats the actual program you're running, it looks like a derivative of PASCAL to extrapolate the data.

    It would be something like
    Begin
    if Text = '' then Text = '$0.00';
    var temp : Float;
    temp = (StrToFloat(Text) * 0.0909);
    End


    temp would be where the result is stored. I haven't used delphi/pascal for 10 years now, and I can't remember how StrToFloat handles the $ symbol.
    Last edited by ProphetVX; 27-06-2008 at 12:00 PM.

  10. #10
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    I've been in contact with their support and they tell me I need to know SQL to be able to do what I need it to do. Fleet Maintenance Pro is the program.

    After looking at it a bit more, it looks like each part of the invoice is a separate table.
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  11. #11
    Ride
    1995 HSV Clubsport T5, 1991 VN Berlina

    Join Date
    Jun 2005
    Location
    Melbourne
    Posts
    5,037

    Default

    Quote Originally Posted by ProphetVX View Post
    Thats not sql.

    Whats the actual program you're running, it looks like a derivative of PASCAL to extrapolate the data.
    i was about to say that. i havent done pascal before but might be able to try learn it to do this

    1995 Manual HSV Clubsport
    Wade Cam :: 9.2:1 CR :: Pacemaker headers :: Twin 2.5" Exhaust :: VT Brakes
    1991 Supercharged VN Berlina
    9 PSI SC14 Intercooled :: Genie headers :: Twin cats :: HM Twin 2.25 exhaust :: 3.45:1 LSD




  12. #12
    Ride
    A Pushie

    Join Date
    Mar 2006
    Location
    Cronulla, NSW
    Posts
    228

    Default

    Quote Originally Posted by Not_An_Abba_Fan View Post
    I've been in contact with their support and they tell me I need to know SQL to be able to do what I need it to do. Fleet Maintenance Pro is the program.

    After looking at it a bit more, it looks like each part of the invoice is a separate table.
    What you're toying around with isn't sql though. Thats real code, to help render the information or process the information once it's already been retrieved from the table.

    If you need more information from the tables, there must be somewhere else that you can edit the sql statements. Refer to my edited post above for a likely close solution.

  13. #13
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    There is a data tab as well, it shows how the data is handled and where it is stored, but there is no place to write and save new code.

    Screen shot of that.
    Attached Thumbnails Attached Thumbnails Sql-sql-data.jpg  
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  14. #14
    Ride
    A Pushie

    Join Date
    Mar 2006
    Location
    Cronulla, NSW
    Posts
    228

    Default

    Quote Originally Posted by Not_An_Abba_Fan View Post
    There is a data tab as well, it shows how the data is handled and where it is stored, but there is no place to write and save new code.

    Screen shot of that.
    Just did a bit of research it seems to use the ODBC connector, which no doubt means it's using a msaccess database in the backend, so all queries are actually stored inside the database, then probably defined and called somehow within the application elsewhere.

    You should be able to access the database file in the root of the application folder, or somewhere in that folder. It will have the extension MDB, you should be able to double click it and it'll open access (provided you have office professional). You should be able to create a query in the design view, just finding the way the program accesses that information is the tricky bit.

    Without it infront of me, there isn't really much else I can help you with. That seems like the most logical pathway that the program works however.

  15. #15
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    Can't access anything through the root folder, there are a heap of IDX and BPL files. In the Data screen, I can right-click the pane and 'edit sql' is an option, but when I click it, all it does is allow me to change what is on the screen, not really any of the actual code.

    In the design view I can change text fields and add images but not any of the data fields. It's only when I generate an invoice that isn't attached to a workorder though, there is a tax value field for workorders but not in invoicing, a bit of an oversight from the developers I think, they mustn't have allowed parts to be charged that aren't attached to a vehicle. Maybe I can create a bogus vehicle just so I can charge miscellaneous parts out.

    I'm waiting on a reply from the support guy, but as he is in the US it's two days turn around.

    Screenshot of the edit sql screen.
    Attached Thumbnails Attached Thumbnails Sql-sql-edit.jpg  
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  16. #16
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    OK, found another part that is editable, but I still don't know the correct statement to make it work.
    Attached Thumbnails Attached Thumbnails Sql-sql-data_1.jpg  
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  17. #17
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    It gets more interesting, after a bit of googling, apparently it is Delphi, doing a bit of a crash course now, hopefully I can figure it out.
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

  18. #18
    Ride
    None

    Join Date
    Jun 2009
    Posts
    0

    Default SQL for Tax component

    I realise this thread is now very old - but I think this is the script that they were after:

    PRL Software - Tax Component

    It calculates the GST component based on the invoice total (or invoiced lines if you want).

  19. #19
    Not_An_Abba_Fan's Avatar
    Not_An_Abba_Fan is offline Exhaust Guru
    Ride
    HSV Senator VTII

    Join Date
    Aug 2006
    Location
    Bunbury, WA
    Posts
    9,098

    Default

    Thanks for that.

    I can find out what to do, but it is the where to do it that is the problem. Everything I try doesn't seem to work.

    Borland Delphi is the program, I have a book here, but it goes through different concepts.
    Visit my Facebook page



    Quote Originally Posted by DannyboyDS View Post
    I burnt my hand in a nasty way once using method one but thats because i'm a twat.

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71