Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

MySQL select, XBasic Function or what to create pop up Window,

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MySQL select, XBasic Function or what to create pop up Window,

    I have a table in a MySql database containing the following fields (among others);
    Tour_ID (int,6)
    Tour_Date (date)
    Tour_Time (char,5)
    Passengers (int,4)
    Rest_Time (char,5) Note: Restaurant time is usually an hour before or after Tour_Time
    Rest_Persons (int,3)

    There may be several Tour_ID's for each Date and Time
    The objective is to show a pop-up window (containing either a R/O grid or list) showing Tour_Time, Passengers, Rest_Persons for a particular day

    This is an upgrade of a program written in Xbase++. In it I create a temporary file with the fields Tour_Time, Passengers, and Rest_Persons where Time is shown as 10:00, 11:00, 12:00, etc. and then show it in a pop-up window.
    The question is how do I do this in Alpha5.
    A Select statement doesn't look like it will work because the Rest_Time is not the same as the Tour_Time.
    I tried creating an XBasic function which creates a temporary file with the appropriate data (summing the passengers and Rest_Persons for each time etc.) but I couldn't figure out how to display it.

    I'm sure that Alpha5 is capable of this but the route to do it is a mystery to me.
    I hope that the explanation of what I am trying to do is clear enough for someone to offer assistance.
    I tried attaching an image (Capacity,png) to this message but it just wiped out my entire message and I had to start over.
    Garry

    #2
    Re: MySQl select, XBasic Function or what to create pop up Window,

    Web application, correct?
    There can be only one.

    Comment


      #3
      Re: MySQl select, XBasic Function or what to create pop up Window,

      Yes, it is a web application.

      Comment


        #4
        Re: MySQl select, XBasic Function or what to create pop up Window,

        Well,
        You can do it quite a few ways.
        You can make a grid that shows the data and open it in a popup window, you can make a report to show the info and open it in a popup window or use a UX/dialog but it seems you may already know that.

        I guess I don't understand why you are saying a query won't work?

        SELECT * from tablename
        WHERE tour_date = '02/24/2014'

        'm sure it's something I'm not understanding from your explanation and how you'd like the data to be sorted?

        Comment


          #5
          Re: MySQl select, XBasic Function or what to create pop up Window,

          Capacity.png
          I hope the proper image attached.
          The select won't work because:
          for eg. 10:00am I want to sum all the passengers, then I want to sum all of the restaurant persons for 10:00am but they are probably in the records with time 9:00am.
          In XBase++ I examined each record individually and added the passengers and restaurant people to the correct slot.
          (The image actually shows the spaces left for each time - each boat and the restaurant have a certain capacity. They use this screen to decide if lunch should be before or after the tour.)

          Comment


            #6
            Re: MySQl select, XBasic Function or what to create pop up Window,

            Originally posted by GGAllen View Post
            [ATTACH=CONFIG]37725[/ATTACH]
            I hope the proper image attached.
            The select won't work because:
            for eg. 10:00am I want to sum all the passengers, then I want to sum all of the restaurant persons for 10:00am but they are probably in the records with time 9:00am.
            In XBase++ I examined each record individually and added the passengers and restaurant people to the correct slot.
            (The image actually shows the spaces left for each time - each boat and the restaurant have a certain capacity. They use this screen to decide if lunch should be before or after the tour.)
            I still see no reason that you can't use a query or a view in combination with a query. I'm still not sure exactly what you want or I'd have a go at it but see this current ongoing thread and the queries in Ghandi's posts near the bottom: http://msgboard.alphasoftware.com/al...rt-Help-Please

            There are a lot of powerful things you can do with queries and views. Maybe a sub-select would work as well

            SELECT A.Tour_Time AS 'Time', A.Boat AS 'Boat', SUM(A.Rest_Persons) AS 'Rest'
            FROM
            (SELECT Tour_Time AS 'Time', SUM(Passengers) AS 'Boat', SUM(Rest_Persons) AS 'Rest.'
            WHERE Tour_Date = '02/25/2014') A
            WHERE Rest_Time <= whatevertime

            I know that's probably not right but you get the idea.
            Last edited by -Jinx-; 02-25-2014, 10:45 AM.

            Comment


              #7
              Re: MySQl select, XBasic Function or what to create pop up Window,

              A select statement just won't work. Suppose there are no reservations for 10:am - I still want to show 10:00 in the grid (or list).
              The only way to do this, I think, is to build a temporary table with the information I want in it - that's what I did in xBase; but how do I build a grid (or some display method) on a file that doesn't exist yet?
              In xBase the temp files were named Capac01,Capac02, etc, to handle multi-user access (where the last 2 digits in the file name were determined by the Station # of the user)
              Also, I'm not sure whether I should use dbf's for the temp file or, because the rest of the program uses SQL, add and drop the table from the database each time.

              Comment


                #8
                Re: MySQL select, XBasic Function or what to create pop up Window,

                Garry,
                It's probably my fault. I'm just having a hard time visualizing exactly what you want.

                If queries/views won't work, I'm pretty sure that a UX component will. You can build that to show pretty much whatever you want. You can build your stuff in an Xbasic within the UX and display it in the controls or even do a freeform layout and put it in there. You can make the UX open in a popup window or DIV or Tab or whatever.

                You could also do it with a report and have that pop up in a window.

                You could also use xBasic with an Ajax Callback to send back the right javascript to populate a DIV with the info you want.

                If you've already built a temp file in xbasic, what's the file format? That can probably be displayed in a dialog or other component as well.

                There are numerous ways to get it done. If I could clearly visualize what you want I could be more specific but I'd go one of those routes.

                Comment


                  #9
                  Re: MySQL select, XBasic Function or what to create pop up Window,

                  Alas, I am building this in V11 thus no UX. The client already has a V11 server which they paid $400 for to run this application and they think that upgrading to a V12 server which will cost them $400/yr is a bit risky since my project is not even complete yet.

                  Comment


                    #10
                    Re: MySQL select, XBasic Function or what to create pop up Window,

                    Dialog will work too for most of the stuff a UX can do.

                    (why is this in the V12 forum?)

                    Comment


                      #11
                      Re: MySQL select, XBasic Function or what to create pop up Window,

                      is it possible to dump the table into a file and upload, then people can work with it to see if they can help you. just one day data should be enough. you can remove sensitive data if you need to.

                      also this is the second time I am seeing time declared as char field as opposed to time field( the other is from Jamie) why?
                      thanks for reading

                      gandhi

                      version 11 3381 - 4096
                      mysql backend
                      http://www.alphawebprogramming.blogspot.com
                      [email protected]
                      Skype:[email protected]
                      1 914 924 5171

                      Comment


                        #12
                        Re: MySQl select, XBasic Function or what to create pop up Window,

                        Originally posted by GGAllen View Post
                        A select statement just won't work. Suppose there are no reservations for 10:am - I still want to show 10:00 in the grid (or list).
                        The only way to do this, I think, is to build a temporary table with the information I want in it - that's what I did in xBase; but how do I build a grid (or some display method) on a file that doesn't exist yet?
                        In xBase the temp files were named Capac01,Capac02, etc, to handle multi-user access (where the last 2 digits in the file name were determined by the Station # of the user)
                        Also, I'm not sure whether I should use dbf's for the temp file or, because the rest of the program uses SQL, add and drop the table from the database each time.
                        Create a table with records for each hour and use that in the select statement.

                        hth

                        Pieter

                        Comment


                          #13
                          Re: MySQL select, XBasic Function or what to create pop up Window,

                          I'm with Pieter on this--had to do something like this with months recently. Then you have something like:

                          SELECT tbl_Hours.Hours_Hour, tbl_Reservations.*
                          FROM tbl_Hours
                          LEFT OUTER JOIN tbl_Reservations ON tbl_Hours.Hours_Hour

                          This returns a row for every hour from your tbl_Hours table and data in those rows from your reservations table that match.

                          Comment


                            #14
                            Re: MySQl select, XBasic Function or what to create pop up Window,

                            Originally posted by GGAllen View Post
                            A select statement just won't work. Suppose there are no reservations for 10:am - I still want to show 10:00 in the grid (or list).
                            The only way to do this, I think, is to build a temporary table with the information I want in it - that's what I did in xBase; but how do I build a grid (or some display method) on a file that doesn't exist yet?
                            In xBase the temp files were named Capac01,Capac02, etc, to handle multi-user access (where the last 2 digits in the file name were determined by the Station # of the user)
                            Also, I'm not sure whether I should use dbf's for the temp file or, because the rest of the program uses SQL, add and drop the table from the database each time.
                            that is exactly to do in MySQL too, I think.
                            first you should create a temp table with proper hourly sequence, populate it with 0 for each hour, then update the hour data for passengers and the restaurant persons from the original table for each hour where the date is equal to the date desired, then select desired fields from this temp table.
                            if you this way then if there were no passengers or persons for a certain hour it will still come out as 0.
                            thanks for reading

                            gandhi

                            version 11 3381 - 4096
                            mysql backend
                            http://www.alphawebprogramming.blogspot.com
                            [email protected]
                            Skype:[email protected]
                            1 914 924 5171

                            Comment


                              #15
                              Re: MySQL select, XBasic Function or what to create pop up Window,

                              Hi


                              A select statement just won't work. Suppose there are no reservations for 10:am - I still want to show 10:00 in the grid (or list).

                              I don't think it is necessary. The method suggested by Pieter and Chris will work fine, but I think there is a simpler way.

                              The MySQL statement will not work as well as above if there are no rows,for a particular time in the original file.

                              MySQL syntax.jpg

                              If you use a syntax similar to the one shown it will force the printing of the row and enter a quantity of 0.

                              This is the solution I produce for the thread Jinx pointed you towards.

                              Michael

                              Comment

                              Working...
                              X