From gustav at cactus.dk Sun May 1 02:01:03 2016 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 1 May 2016 07:01:03 +0000 Subject: [AccessD] After having picked a date Message-ID: Hi All I've found a solution to a problem that have bothered me ever since the datepicker was introduced: How to move on after having picked a date? I found out that all you may have to do is to move the mouse: Private Sub Detailsection_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) ' Adjust control names to fit your form. Const DateTextboxName As String = "txtOrderDate" Const NextFocusControl As String = "txtShipDate" ' Ignore errors from validation or the like that ' will block setting focus to NextFocusControl. On Error Resume Next If Screen.ActiveControl.Name = DateTextboxName Then With Me(DateTextboxName) If IsDate(.Text) Then If IsNull(.Value) Or DateDiff("d", DateValue(.Text), .Value) <> 0 Then Me(NextFocusControl).SetFocus End If End If End With End If End Sub /gustav From bensonforums at gmail.com Sun May 1 08:32:51 2016 From: bensonforums at gmail.com (Bill Benson) Date: Sun, 1 May 2016 09:32:51 -0400 Subject: [AccessD] White screen In-Reply-To: <572154DD.306@gmail.com> References: <5720E857.7080800@gmail.com> <5721338B.13619.1CFDB275@stuart.lexacorp.com.pg> <572154DD.306@gmail.com> Message-ID: Fred it's far past a day and I am anxious awaiting the next installment. .. how is it going? On Apr 27, 2016 8:12 PM, "Fred Hooper" wrote: > Weird. > > When I ran the code that the view runs in Management studio it executed > the code once, taking 982 miliseconds and showed the code that I ran. > > When I selected * from the view in MS it executed it once, taking 997 > miliseconds. > > When I double-clicked the "table" linking to the user view, it first ran > the selection from the view, taking 144 miliseconds. Then, it ran > sp_execute six times for a bit more than 800 ms each, for a total of > about 4850 ms. > > When, I allowed the Requerey to execute it ran more than 400 lines in > the profiler, each just under a second. However, because I'd run from > the "table" above, the form wasn't maximized. When I clicked it to > maximize it ran another 230 lines, at the same pace but pausing > occasionally. Then, I hit the [Close] button and it ran another 22 lines > at 1 second each before it closed. > > Finally, when I ran it normally, it ran 480 lines in the profiler at > about a second each -- reasonably close to my 10 minute estimate. > > It's clear that you've put your finger on the problem. Thank you. > > It seemed such an elegant solution, it's too bad it doesn't work. Do you > have any idea what's going on? > > I'll run the profiler with simple link structures tomorrow and post the > results. > > Thanks again, > Fred > > Stuart McLachlan > > Wednesday, April 27, 2016 5:47 PM > > Do you have parent/child links between the form and subform? > > > > Where is your Form_Subform.requery triggered, what exactly is the code > > that does this? > > > > >From your description. the requery is being called repeatedly - you > > should be able to monitor > > the connection in SQL Serv Management Studio to confirm this. > > > > What happens if you build a simple query to a single temporary local > > table and try exactly the > > same process with that? > > > > > > > > ... > > > > Fred Hooper > > Wednesday, April 27, 2016 12:27 PM > > Hi All, > > > > I'm converting someone else's Access 2002 program to a SQL Server 14 > > back end. I apologize in advance for the amount of information, but I > > didn't want to waste your time suggesting something that I've already > > tried. And, since I've been unable to find much help on the web, > > apparently my problem is unusual. > > > > Background: > > When I asked a question about converting to SQL server relating to > > dbSync a few weeks ago I received two suggestions: > > > > 1. Improve the network speed. I did that but it made only a small > > difference. > > 2. Just replace the links to the Access back end with links to SQL > > server. This didn't work; too slow. > > 1. Most of the queries that feed the forms are complex; 8-15 > > tables, mostly outer joins and many fields (so the same query > > can be used for different purposes). It took upwards of 20 > > minutes to populate a form with this approach. > > 2. I moved most of the queries to SQL Server and linked to them. > > This reduced the time to populate to 10 minute, still > > unacceptable. > > 3. BTW, all of the queries, direct and indirect, populate much more > > quickly from the database window; it's just populating through the > > forms that is causing me problems. > > > > So I moved to a more complex approach: > > > > * Non-editable forms are populated by ADO recordsets. This is quick > > and works fine. > > * Editable forms are the problem > > o Because the back end doesn't enforce referential integrity > > (reference link > > < > http://rogersaccessblog.blogspot.com/2009/11/this-recordset-is-not-updateable-why.html > >) > > I can't update through the complex queries in the recordsets. > > o So I'm trying "user views": Views named for the pc/user > > concatenation (because users can be logged in on multiple > > pc's). For example: > > + A view named "QryActionsReport_2_PUGET-88049" contains the > > SQL code "SELECT * from dbo.qryActionsReport WHERE > > charindex('jones',[cusCompanyName]) > 0". This returns 80 > > records. > > + This query replaces the QryActionsReport query in the > > database window, but the local name doesn't change. A > > proper unique index is applied. > > + In the database window the query populates in 4-5 seconds > > and is editable. > > + This process effectively creates an editable passthru query > > o The main form has no data source. There's a single subform > > with QryActionsReport as its RecordSource. The user view when > > the form is opened has "where 1=0", and populates instantly. > > + The code changes the user view to look for 'jones' and the > > local query link is refreshed. > > + I repopulate the subform with "Form_SubformName.Requery" > > and my problem begins: > > # It seems to take forever, actually just 10 minutes. > > # On the subform 6 lines are slowly populated, 2 seconds > > per line. Then, the subform blanks, and it slowly > > repeats 22(!) times > > # Interestingly, code that executes after the Requery to > > populate another field is executed immediately after I > > press the button to populate the subform, while the > > first record on the subform is slowly filling. > > # After the subform seems populated it still isn't > > ready. If I click on the main form a couple of times > > the whole form gets a whitish overlay (the "white > > screen" in my subject) and I can no longer get to the > > open code window. > > # After the form can be used and I close it the form is > > no longer maximized and the subform begins to populate > > again, filling 6 lines slowly, before it finally closes. > > * Things I've tried that haven't worked > > o Changing the link to the user view between ODBC and DSN-less. > > (I'm using ODBC 11, the native connection to SQL Server 12 and > > 14.) > > o Temporarily used Debug.Print in the subform Current event, but > > it fires only once and does so immediately. There's no Current > > event in the main form as it has no data. > > o As the program uses only maximized forms, I put a check for > > already-maximized in the main form's Activate event. > > o Installed the most recent video driver > > o Changed the display driver from generic to the specific display > > o Changed from a development version of SQL Server 2012 to SQL > > Server 2014 Express > > * Things I've thought of trying, but haven't yet > > o Establish referential integrity in the back end > > o Buy a video card to replace the motherboard-included Intel > > 3000 display "card" > > > > My PC is 3 years old with all programs and operating system (Win 7 > > pro) up-to-date. All code and data is operating off a solid-state hard > > drive. > > > > I really appreciate your reading so much and I hope that you can help me. > > > > Best regards, > > Fred Hooper > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From kost36 at otenet.gr Tue May 3 14:01:45 2016 From: kost36 at otenet.gr (Kostas Konstantinidis) Date: Tue, 3 May 2016 22:01:45 +0300 Subject: [AccessD] mysql query dosen't filter on HAVING Message-ID: <012901d1a56e$3f05def0$bd119cd0$@otenet.gr> Hi group I use a mysql query like VIEW `2nd_movie` AS SELECT DISTINCT `ST_peoplefilms`.`ID_films` AS `ID_films`, `ST_peoplefilms`.`ID_idiotita` AS `ID_idiotita`, `MT_films`.`Title1` AS `Title1`, `MT_films`.`room_last` AS `room_last`, `MT_films`.`etos` AS `etos`, `MT_films`.`katigoria` AS `katigoria`, `MT_films`.`diarkeia` AS `diarkeia`, `MT_films`.`proeleysiSenarioy` AS `proeleysiSenarioy`, GROUP_CONCAT(DISTINCT `T_people`.`person` ORDER BY `T_people`.`person` ASC SEPARATOR ', ') AS `person`, CONCAT_WS(' - ', `MT_films`.`Title1`, `MT_films`.`Title2`, `MT_films`.`Title3`, `MT_films`.`title4`) AS `Titles` FROM ((`MT_films` JOIN `ST_peoplefilms` ON ((`MT_films`.`ID_films` = `ST_peoplefilms`.`ID_films`))) LEFT JOIN `T_people` ON ((`T_people`.`ID_person` = `ST_peoplefilms`.`ID_person`))) GROUP BY `ST_peoplefilms`.`ID_films` HAVING ((`ST_peoplefilms`.`ID_idiotita` = 29) AND (`MT_films`.`room_last` = 3)) But it doesn't filter on ID_idiotita=29 which is related to Director(s) of the movie It returns all the other crew values as well Am I missing something in that? Thank's /kostas From kost36 at otenet.gr Tue May 3 14:45:17 2016 From: kost36 at otenet.gr (Kostas Konstantinidis) Date: Tue, 3 May 2016 22:45:17 +0300 Subject: [AccessD] mysql query dosen't filter on HAVING In-Reply-To: <012901d1a56e$3f05def0$bd119cd0$@otenet.gr> References: <012901d1a56e$3f05def0$bd119cd0$@otenet.gr> Message-ID: <013001d1a574$52c979a0$f85c6ce0$@otenet.gr> Solved.... I was just blind... I missed the WHERE!!!! Sorry Thank's /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Tuesday, May 3, 2016 10:02 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] mysql query dosen't filter on HAVING Hi group I use a mysql query like VIEW `2nd_movie` AS SELECT DISTINCT `ST_peoplefilms`.`ID_films` AS `ID_films`, `ST_peoplefilms`.`ID_idiotita` AS `ID_idiotita`, `MT_films`.`Title1` AS `Title1`, `MT_films`.`room_last` AS `room_last`, `MT_films`.`etos` AS `etos`, `MT_films`.`katigoria` AS `katigoria`, `MT_films`.`diarkeia` AS `diarkeia`, `MT_films`.`proeleysiSenarioy` AS `proeleysiSenarioy`, GROUP_CONCAT(DISTINCT `T_people`.`person` ORDER BY `T_people`.`person` ASC SEPARATOR ', ') AS `person`, CONCAT_WS(' - ', `MT_films`.`Title1`, `MT_films`.`Title2`, `MT_films`.`Title3`, `MT_films`.`title4`) AS `Titles` FROM ((`MT_films` JOIN `ST_peoplefilms` ON ((`MT_films`.`ID_films` = `ST_peoplefilms`.`ID_films`))) LEFT JOIN `T_people` ON ((`T_people`.`ID_person` = `ST_peoplefilms`.`ID_person`))) GROUP BY `ST_peoplefilms`.`ID_films` HAVING ((`ST_peoplefilms`.`ID_idiotita` = 29) AND (`MT_films`.`room_last` = 3)) But it doesn't filter on ID_idiotita=29 which is related to Director(s) of the movie It returns all the other crew values as well Am I missing something in that? Thank's /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Wed May 4 10:30:35 2016 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Wed, 4 May 2016 08:30:35 -0700 Subject: [AccessD] Importing XLSX Message-ID: Dear List: I'm still using 2003 for development - should probably up to 2010. However... I have an app which requires processing data from XL spreadsheets. My usual method is to use TransferSpreadsheet into a front end table and process the records from there. However, TransferSpreadsheet doesn't seem to like xlsx format. If I save the file as xls, no problem. Is there a way to use TransferSpreadsheet on an xlsx file in A2003? MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin From jimdettman at verizon.net Wed May 4 11:27:05 2016 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 04 May 2016 12:27:05 -0400 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: None. You have two basic options: 1. An ad-hoc utility run with task manager to do a .xlsx to .xls conversion. 2. Have whoever is supplying the data give it to you in .csv format. Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, May 04, 2016 11:31 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Importing XLSX Dear List: I'm still using 2003 for development - should probably up to 2010. However... I have an app which requires processing data from XL spreadsheets. My usual method is to use TransferSpreadsheet into a front end table and process the records from there. However, TransferSpreadsheet doesn't seem to like xlsx format. If I save the file as xls, no problem. Is there a way to use TransferSpreadsheet on an xlsx file in A2003? MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Wed May 4 13:06:25 2016 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 4 May 2016 14:06:25 -0400 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: Automate Excel through Access. If Excel 2007 and higher is your most recently installed Excel version, that will be used to open the .xlsx file, then saveas in code paying particular attention to both extension and the fileformat intrinsic constant for 2003 files, which to Excel is xlExcel8 but if you use CreateObject instead of setting a reference to Excel, use 56. Then use Transfer spreadsheet. If you have most recently installed Excel 2003, then that is what will open the file, and it will be in Compatibility mode. Likewise do a SaveAs, but I am not sure there was a FileFormat property back then. If there was, it likely was not 56, it might have been some number in the 4000's. On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: Dear List: I'm still using 2003 for development - should probably up to 2010. However... I have an app which requires processing data from XL spreadsheets. My usual method is to use TransferSpreadsheet into a front end table and process the records from there. However, TransferSpreadsheet doesn't seem to like xlsx format. If I save the file as xls, no problem. Is there a way to use TransferSpreadsheet on an xlsx file in A2003? MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at aig.com Wed May 4 13:36:47 2016 From: Lambert.Heenan at aig.com (Heenan, Lambert) Date: Wed, 4 May 2016 18:36:47 +0000 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: It's been a while, so I don't exactly remember, but I think that if you install the MS Office Compatibility Pack, then Access will be able to read .xlsx files. The SW is available here... https://www.microsoft.com/en-us/download/details.aspx?id=3 Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Wednesday, May 04, 2016 2:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Importing XLSX Automate Excel through Access. If Excel 2007 and higher is your most recently installed Excel version, that will be used to open the .xlsx file, then saveas in code paying particular attention to both extension and the fileformat intrinsic constant for 2003 files, which to Excel is xlExcel8 but if you use CreateObject instead of setting a reference to Excel, use 56. Then use Transfer spreadsheet. If you have most recently installed Excel 2003, then that is what will open the file, and it will be in Compatibility mode. Likewise do a SaveAs, but I am not sure there was a FileFormat property back then. If there was, it likely was not 56, it might have been some number in the 4000's. On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: Dear List: I'm still using 2003 for development - should probably up to 2010. However... I have an app which requires processing data from XL spreadsheets. My usual method is to use TransferSpreadsheet into a front end table and process the records from there. However, TransferSpreadsheet doesn't seem to like xlsx format. If I save the file as xls, no problem. Is there a way to use TransferSpreadsheet on an xlsx file in A2003? MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From tinanfields at torchlake.com Wed May 4 14:07:02 2016 From: tinanfields at torchlake.com (Tina Norris Fields) Date: Wed, 4 May 2016 15:07:02 -0400 Subject: [AccessD] Issues of many-many relationships Message-ID: Hi, This should be easy, I'm sure, and I should know how to do it, but I'm having trouble with it. The examples I regularly find that deal with the many-many relationship are a bunch like this: Students --> Student-Class <-- Classes Where students may take several classes and classes may have several students, so, we create a details or junction table, containing the FK for student and FK for class - giving us one record for each combination of student-and-class. Great! But, this depends on existing data in both the Students table and the Classes table. Now, I'm dealing with a slightly different case. I have a table of Persons and a table of their Files. Each Person could have several Files, and each File could apply to several Persons. (As an example, one File could be estate planning for a married couple, so the file applies to two individuals.) Clearly, this is a many-many relationship, requiring a junction table. Persons --> Person-File <-- Files No problem creating a query to display the files pertaining to any one person. But, from here, how to create a new File for an existing Person? The Person-File table cannot have a new entry, because it requires an existing matching entry in each of the tables, Persons and Files. So, what the heck am I missing? What am I doing wrong? Any help getting my brain around this is appreciated. Thanks TNF -- Tina Norris Fields tinanfields-at-torchlake-dot-com 231-322-2787 From jackandpat.d at gmail.com Wed May 4 14:20:36 2016 From: jackandpat.d at gmail.com (jack drawbridge) Date: Wed, 4 May 2016 15:20:36 -0400 Subject: [AccessD] Issues of many-many relationships In-Reply-To: References: Message-ID: Tina, I think you first have to add the File to the tblFile, then you could associate that file with Person X. Similarly if there is a new Person, you would add the person to tblPerson and then associate that Person with a selected File. Just typing while thinking... good luck. On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < tinanfields at torchlake.com> wrote: > Hi, > > This should be easy, I'm sure, and I should know how to do it, but I'm > having trouble with it. > > The examples I regularly find that deal with the many-many relationship > are a bunch like this: > > Students --> Student-Class <-- Classes > > Where students may take several classes and classes may have several > students, so, we create a details or junction table, containing the FK for > student and FK for class - giving us one record for each combination of > student-and-class. Great! But, this depends on existing data in both the > Students table and the Classes table. > > Now, I'm dealing with a slightly different case. I have a table of > Persons and a table of their Files. Each Person could have several Files, > and each File could apply to several Persons. (As an example, one File > could be estate planning for a married couple, so the file applies to two > individuals.) Clearly, this is a many-many relationship, requiring a > junction table. > > Persons --> Person-File <-- Files > > No problem creating a query to display the files pertaining to any one > person. But, from here, how to create a new File for an existing Person? > The Person-File table cannot have a new entry, because it requires an > existing matching entry in each of the tables, Persons and Files. > > So, what the heck am I missing? What am I doing wrong? Any help getting > my brain around this is appreciated. > > Thanks > TNF > > -- > Tina Norris Fields > tinanfields-at-torchlake-dot-com > 231-322-2787 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rockysmolin at bchacc.com Wed May 4 15:10:18 2016 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Wed, 4 May 2016 13:10:18 -0700 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: Lambert: Thanks for your reply. I'm pretty sure I have the compatibility pack installed because I can open xlsx files with Excel 2003 but I downloaded and installed anyway. However, I still got the 'not in the expected format' message when using TransferSpreadsheet. I have to talk to the client to see if they can provide a .CSV file - that would work around the problem altogether. Barring that, perhaps I can open the spreadsheet directly and process it that way. Best, Rocky -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, May 04, 2016 11:37 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Importing XLSX It's been a while, so I don't exactly remember, but I think that if you install the MS Office Compatibility Pack, then Access will be able to read .xlsx files. The SW is available here... https://www.microsoft.com/en-us/download/details.aspx?id=3 Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Wednesday, May 04, 2016 2:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Importing XLSX Automate Excel through Access. If Excel 2007 and higher is your most recently installed Excel version, that will be used to open the .xlsx file, then saveas in code paying particular attention to both extension and the fileformat intrinsic constant for 2003 files, which to Excel is xlExcel8 but if you use CreateObject instead of setting a reference to Excel, use 56. Then use Transfer spreadsheet. If you have most recently installed Excel 2003, then that is what will open the file, and it will be in Compatibility mode. Likewise do a SaveAs, but I am not sure there was a FileFormat property back then. If there was, it likely was not 56, it might have been some number in the 4000's. On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: Dear List: I'm still using 2003 for development - should probably up to 2010. However... I have an app which requires processing data from XL spreadsheets. My usual method is to use TransferSpreadsheet into a front end table and process the records from there. However, TransferSpreadsheet doesn't seem to like xlsx format. If I save the file as xls, no problem. Is there a way to use TransferSpreadsheet on an xlsx file in A2003? MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Wed May 4 15:41:32 2016 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 4 May 2016 16:41:32 -0400 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: In what way did my suggestion not satisfy or not even deserve a thanks but no thanks Rocky? Payback for my inattention to one of your own replies in the past? On May 4, 2016 4:12 PM, "Rocky Smolin" wrote: > Lambert: > > Thanks for your reply. I'm pretty sure I have the compatibility pack > installed because I can open xlsx files with Excel 2003 but I downloaded > and > installed anyway. However, I still got the 'not in the expected format' > message when using TransferSpreadsheet. > > I have to talk to the client to see if they can provide a .CSV file - that > would work around the problem altogether. > > Barring that, perhaps I can open the spreadsheet directly and process it > that way. > > Best, > > Rocky > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Heenan, Lambert > Sent: Wednesday, May 04, 2016 11:37 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Importing XLSX > > It's been a while, so I don't exactly remember, but I think that if you > install the MS Office Compatibility Pack, then Access will be able to read > .xlsx files. The SW is available here... > > https://www.microsoft.com/en-us/download/details.aspx?id=3 > > > Lambert > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Bill Benson > Sent: Wednesday, May 04, 2016 2:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Importing XLSX > > Automate Excel through Access. If Excel 2007 and higher is your most > recently installed Excel version, that will be used to open the .xlsx file, > then saveas in code paying particular attention to both extension and the > fileformat intrinsic constant for 2003 files, which to Excel is xlExcel8 > but > if you use CreateObject instead of setting a reference to Excel, use 56. > Then use Transfer spreadsheet. > > If you have most recently installed Excel 2003, then that is what will open > the file, and it will be in Compatibility mode. Likewise do a SaveAs, but I > am not sure there was a FileFormat property back then. If there was, it > likely was not 56, it might have been some number in the 4000's. > On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: > > Dear List: > > I'm still using 2003 for development - should probably up to 2010. > However... > > I have an app which requires processing data from XL spreadsheets. My > usual > method is to use TransferSpreadsheet into a front end table and process the > records from there. > > However, TransferSpreadsheet doesn't seem to like xlsx format. If I save > the > file as xls, no problem. > > Is there a way to use TransferSpreadsheet on an xlsx file in A2003? > > MTIA > > Rocky Smolin > Beach Access Software > 760-683-5777 > www.bchacc.com > www.e-z-mrp.com > Skype: rocky.smolin > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From marksimms at verizon.net Wed May 4 15:52:37 2016 From: marksimms at verizon.net (Mark Simms) Date: Wed, 04 May 2016 16:52:37 -0400 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: <009901d1a646$e4bc6b10$ae354130$@net> Use the CSV format....XLS limited to 65k rows. You will lose data if you convert from XLSX to XLS with over 65K rows in a worksheet. XLSX can hold 1 million rows. CSV can hold 1 trillion rows. > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Rocky Smolin > Sent: Wednesday, May 04, 2016 4:10 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Importing XLSX > > Lambert: > > Thanks for your reply. I'm pretty sure I have the compatibility pack > installed because I can open xlsx files with Excel 2003 but I > downloaded and > installed anyway. However, I still got the 'not in the expected > format' > message when using TransferSpreadsheet. > > I have to talk to the client to see if they can provide a .CSV file - > that > would work around the problem altogether. > > Barring that, perhaps I can open the spreadsheet directly and process > it > that way. > > Best, > > Rocky > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of > Heenan, Lambert > Sent: Wednesday, May 04, 2016 11:37 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Importing XLSX > > It's been a while, so I don't exactly remember, but I think that if you > install the MS Office Compatibility Pack, then Access will be able to > read > .xlsx files. The SW is available here... > > https://www.microsoft.com/en-us/download/details.aspx?id=3 > > > Lambert > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of > Bill Benson > Sent: Wednesday, May 04, 2016 2:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Importing XLSX > > Automate Excel through Access. If Excel 2007 and higher is your most > recently installed Excel version, that will be used to open the .xlsx > file, > then saveas in code paying particular attention to both extension and > the > fileformat intrinsic constant for 2003 files, which to Excel is > xlExcel8 but > if you use CreateObject instead of setting a reference to Excel, use > 56. > Then use Transfer spreadsheet. > > If you have most recently installed Excel 2003, then that is what will > open > the file, and it will be in Compatibility mode. Likewise do a SaveAs, > but I > am not sure there was a FileFormat property back then. If there was, it > likely was not 56, it might have been some number in the 4000's. > On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: > > Dear List: > > I'm still using 2003 for development - should probably up to 2010. > However... > > I have an app which requires processing data from XL spreadsheets. My > usual > method is to use TransferSpreadsheet into a front end table and process > the > records from there. > > However, TransferSpreadsheet doesn't seem to like xlsx format. If I > save the > file as xls, no problem. > > Is there a way to use TransferSpreadsheet on an xlsx file in A2003? > > MTIA > > Rocky Smolin > Beach Access Software > 760-683-5777 > www.bchacc.com > www.e-z-mrp.com > Skype: rocky.smolin > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From bradm at blackforestltd.com Wed May 4 16:15:50 2016 From: bradm at blackforestltd.com (Brad Marks) Date: Wed, 4 May 2016 21:15:50 +0000 Subject: [AccessD] Microsoft Access Application to Record, Organize, and Prioritize IT Requests from other Departments In-Reply-To: <832526796.18798345.1380643351154.JavaMail.root@cds002> References: <832526796.18798345.1380643351154.JavaMail.root@cds002> Message-ID: All, A friend who works for another small firm (50 employees) recently asked me if I knew of any inexpensive (or free) system that could be used to Record, Organize, and Prioritize IT Requests from other Departments. I am curious if there is a Microsoft Access template for such use or perhaps a small system that someone else has developed for this purpose. I have looked at the Access templates but have not found a good fit yet. Any ideas or suggestions would be appreciated. Thanks, Brad From stehicks at pacbell.net Wed May 4 16:36:57 2016 From: stehicks at pacbell.net (Steve) Date: Wed, 4 May 2016 14:36:57 -0700 Subject: [AccessD] Issues of many-many relationships In-Reply-To: References: Message-ID: <000001d1a64d$16335310$4299f930$@pacbell.net> Tina, I have attached a diagram (many-to-many.pdf) that explains what is needed for many to many relationships. You can add people or files independently as needed. Steve -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jack drawbridge Sent: Wednesday, May 04, 2016 12:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Issues of many-many relationships Tina, I think you first have to add the File to the tblFile, then you could associate that file with Person X. Similarly if there is a new Person, you would add the person to tblPerson and then associate that Person with a selected File. Just typing while thinking... good luck. On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < tinanfields at torchlake.com> wrote: > Hi, > > This should be easy, I'm sure, and I should know how to do it, but I'm > having trouble with it. > > The examples I regularly find that deal with the many-many > relationship are a bunch like this: > > Students --> Student-Class <-- Classes > > Where students may take several classes and classes may have several > students, so, we create a details or junction table, containing the FK > for student and FK for class - giving us one record for each > combination of student-and-class. Great! But, this depends on > existing data in both the Students table and the Classes table. > > Now, I'm dealing with a slightly different case. I have a table of > Persons and a table of their Files. Each Person could have several > Files, and each File could apply to several Persons. (As an example, > one File could be estate planning for a married couple, so the file > applies to two > individuals.) Clearly, this is a many-many relationship, requiring a > junction table. > > Persons --> Person-File <-- Files > > No problem creating a query to display the files pertaining to any one > person. But, from here, how to create a new File for an existing Person? > The Person-File table cannot have a new entry, because it requires an > existing matching entry in each of the tables, Persons and Files. > > So, what the heck am I missing? What am I doing wrong? Any help > getting my brain around this is appreciated. > > Thanks > TNF > > -- > Tina Norris Fields > tinanfields-at-torchlake-dot-com > 231-322-2787 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed May 4 16:39:28 2016 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 04 May 2016 17:39:28 -0400 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: <> Yes, you could control Excel through automation and read it cell by cell. But you can't do it with Access. The compatibility pack does not update the .DLL's that Access uses. Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, May 04, 2016 04:10 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Importing XLSX Lambert: Thanks for your reply. I'm pretty sure I have the compatibility pack installed because I can open xlsx files with Excel 2003 but I downloaded and installed anyway. However, I still got the 'not in the expected format' message when using TransferSpreadsheet. I have to talk to the client to see if they can provide a .CSV file - that would work around the problem altogether. Barring that, perhaps I can open the spreadsheet directly and process it that way. Best, Rocky -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, May 04, 2016 11:37 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Importing XLSX It's been a while, so I don't exactly remember, but I think that if you install the MS Office Compatibility Pack, then Access will be able to read .xlsx files. The SW is available here... https://www.microsoft.com/en-us/download/details.aspx?id=3 Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Wednesday, May 04, 2016 2:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Importing XLSX Automate Excel through Access. If Excel 2007 and higher is your most recently installed Excel version, that will be used to open the .xlsx file, then saveas in code paying particular attention to both extension and the fileformat intrinsic constant for 2003 files, which to Excel is xlExcel8 but if you use CreateObject instead of setting a reference to Excel, use 56. Then use Transfer spreadsheet. If you have most recently installed Excel 2003, then that is what will open the file, and it will be in Compatibility mode. Likewise do a SaveAs, but I am not sure there was a FileFormat property back then. If there was, it likely was not 56, it might have been some number in the 4000's. On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: Dear List: I'm still using 2003 for development - should probably up to 2010. However... I have an app which requires processing data from XL spreadsheets. My usual method is to use TransferSpreadsheet into a front end table and process the records from there. However, TransferSpreadsheet doesn't seem to like xlsx format. If I save the file as xls, no problem. Is there a way to use TransferSpreadsheet on an xlsx file in A2003? MTIA Rocky Smolin Beach Access Software 760-683-5777 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed May 4 16:39:10 2016 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 4 May 2016 14:39:10 -0700 Subject: [AccessD] Microsoft Access Application to Record, Organize, and Prioritize IT Requests from other Departments In-Reply-To: References: <832526796.18798345.1380643351154.JavaMail.root@cds002> Message-ID: A version of project tracking software might be good. I've read good reviews of trello.com, which is free for the light version. Doug On Wed, May 4, 2016 at 2:15 PM, Brad Marks wrote: > All, > > A friend who works for another small firm (50 employees) recently asked me > if I knew of any inexpensive (or free) system that could be used to Record, > Organize, and Prioritize IT Requests from other Departments. > > I am curious if there is a Microsoft Access template for such use or > perhaps a small system that someone else has developed for this purpose. I > have looked at the Access templates but have not found a good fit yet. > > Any ideas or suggestions would be appreciated. > > Thanks, > > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bensonforums at gmail.com Wed May 4 17:04:32 2016 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 4 May 2016 18:04:32 -0400 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: Jim I already suggested Automation and if you simply save the file as XLS you will not have to read anything cell by cell On May 4, 2016 5:38 PM, "Jim Dettman" wrote: > < that way.>> > > Yes, you could control Excel through automation and read it cell by cell. > > But you can't do it with Access. The compatibility pack does not update > the > .DLL's that Access uses. > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Rocky Smolin > Sent: Wednesday, May 04, 2016 04:10 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Importing XLSX > > Lambert: > > Thanks for your reply. I'm pretty sure I have the compatibility pack > installed because I can open xlsx files with Excel 2003 but I downloaded > and > installed anyway. However, I still got the 'not in the expected format' > message when using TransferSpreadsheet. > > I have to talk to the client to see if they can provide a .CSV file - that > would work around the problem altogether. > > Barring that, perhaps I can open the spreadsheet directly and process it > that way. > > Best, > > Rocky > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Heenan, Lambert > Sent: Wednesday, May 04, 2016 11:37 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Importing XLSX > > It's been a while, so I don't exactly remember, but I think that if you > install the MS Office Compatibility Pack, then Access will be able to read > .xlsx files. The SW is available here... > > https://www.microsoft.com/en-us/download/details.aspx?id=3 > > > Lambert > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Bill Benson > Sent: Wednesday, May 04, 2016 2:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Importing XLSX > > Automate Excel through Access. If Excel 2007 and higher is your most > recently installed Excel version, that will be used to open the .xlsx file, > then saveas in code paying particular attention to both extension and the > fileformat intrinsic constant for 2003 files, which to Excel is xlExcel8 > but > if you use CreateObject instead of setting a reference to Excel, use 56. > Then use Transfer spreadsheet. > > If you have most recently installed Excel 2003, then that is what will open > the file, and it will be in Compatibility mode. Likewise do a SaveAs, but I > am not sure there was a FileFormat property back then. If there was, it > likely was not 56, it might have been some number in the 4000's. > On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: > > Dear List: > > I'm still using 2003 for development - should probably up to 2010. > However... > > I have an app which requires processing data from XL spreadsheets. My > usual > method is to use TransferSpreadsheet into a front end table and process the > records from there. > > However, TransferSpreadsheet doesn't seem to like xlsx format. If I save > the > file as xls, no problem. > > Is there a way to use TransferSpreadsheet on an xlsx file in A2003? > > MTIA > > Rocky Smolin > Beach Access Software > 760-683-5777 > www.bchacc.com > www.e-z-mrp.com > Skype: rocky.smolin > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Wed May 4 17:08:05 2016 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 05 May 2016 08:08:05 +1000 Subject: [AccessD] Importing XLSX In-Reply-To: <009901d1a646$e4bc6b10$ae354130$@net> References: , , <009901d1a646$e4bc6b10$ae354130$@net> Message-ID: <572A72C5.1304.411C8BEF@stuart.lexacorp.com.pg> CSV files are evil! Use a Tab delimited format. :) -- Stuart On 4 May 2016 at 16:52, Mark Simms wrote: > Use the CSV format....XLS limited to 65k rows. > You will lose data if you convert from XLSX to XLS with over 65K rows in a > worksheet. > XLSX can hold 1 million rows. > CSV can hold 1 trillion rows. > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of Rocky Smolin > > Sent: Wednesday, May 04, 2016 4:10 PM > > To: 'Access Developers discussion and problem solving' > > Subject: Re: [AccessD] Importing XLSX > > > > Lambert: > > > > Thanks for your reply. I'm pretty sure I have the compatibility pack > > installed because I can open xlsx files with Excel 2003 but I > > downloaded and > > installed anyway. However, I still got the 'not in the expected > > format' > > message when using TransferSpreadsheet. > > > > I have to talk to the client to see if they can provide a .CSV file - > > that > > would work around the problem altogether. > > > > Barring that, perhaps I can open the spreadsheet directly and process > > it > > that way. > > > > Best, > > > > Rocky > > > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of > > Heenan, Lambert > > Sent: Wednesday, May 04, 2016 11:37 AM > > To: 'Access Developers discussion and problem solving' > > Subject: Re: [AccessD] Importing XLSX > > > > It's been a while, so I don't exactly remember, but I think that if you > > install the MS Office Compatibility Pack, then Access will be able to > > read > > .xlsx files. The SW is available here... > > > > https://www.microsoft.com/en-us/download/details.aspx?id=3 > > > > > > Lambert > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > > Of > > Bill Benson > > Sent: Wednesday, May 04, 2016 2:06 PM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Importing XLSX > > > > Automate Excel through Access. If Excel 2007 and higher is your most > > recently installed Excel version, that will be used to open the .xlsx > > file, > > then saveas in code paying particular attention to both extension and > > the > > fileformat intrinsic constant for 2003 files, which to Excel is > > xlExcel8 but > > if you use CreateObject instead of setting a reference to Excel, use > > 56. > > Then use Transfer spreadsheet. > > > > If you have most recently installed Excel 2003, then that is what will > > open > > the file, and it will be in Compatibility mode. Likewise do a SaveAs, > > but I > > am not sure there was a FileFormat property back then. If there was, it > > likely was not 56, it might have been some number in the 4000's. > > On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: > > > > Dear List: > > > > I'm still using 2003 for development - should probably up to 2010. > > However... > > > > I have an app which requires processing data from XL spreadsheets. My > > usual > > method is to use TransferSpreadsheet into a front end table and process > > the > > records from there. > > > > However, TransferSpreadsheet doesn't seem to like xlsx format. If I > > save the > > file as xls, no problem. > > > > Is there a way to use TransferSpreadsheet on an xlsx file in A2003? > > > > MTIA > > > > Rocky Smolin > > Beach Access Software > > 760-683-5777 > > www.bchacc.com > > www.e-z-mrp.com > > Skype: rocky.smolin > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From tinanfields at torchlake.com Wed May 4 17:09:58 2016 From: tinanfields at torchlake.com (Tina Norris Fields) Date: Wed, 4 May 2016 18:09:58 -0400 Subject: [AccessD] Issues of many-many relationships In-Reply-To: References: Message-ID: Yes, that's been my experience. But, I want to be able to create a new file to be associated with that person, and that isn't working because the intermediate table requires a matching entry in the primary table. TNF Tina Norris Fields tinanfields-at-torchlake-dot-com 231-322-2787 On 05/04/16 3:20 PM, jack drawbridge wrote: > Tina, > > I think you first have to add the File to the tblFile, then you could > associate that file with Person X. > Similarly if there is a new Person, you would add the person to tblPerson > and then associate that Person with a selected File. > Just typing while thinking... > good luck. > > On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < > tinanfields at torchlake.com> wrote: > >> Hi, >> >> This should be easy, I'm sure, and I should know how to do it, but I'm >> having trouble with it. >> >> The examples I regularly find that deal with the many-many relationship >> are a bunch like this: >> >> Students --> Student-Class <-- Classes >> >> Where students may take several classes and classes may have several >> students, so, we create a details or junction table, containing the FK for >> student and FK for class - giving us one record for each combination of >> student-and-class. Great! But, this depends on existing data in both the >> Students table and the Classes table. >> >> Now, I'm dealing with a slightly different case. I have a table of >> Persons and a table of their Files. Each Person could have several Files, >> and each File could apply to several Persons. (As an example, one File >> could be estate planning for a married couple, so the file applies to two >> individuals.) Clearly, this is a many-many relationship, requiring a >> junction table. >> >> Persons --> Person-File <-- Files >> >> No problem creating a query to display the files pertaining to any one >> person. But, from here, how to create a new File for an existing Person? >> The Person-File table cannot have a new entry, because it requires an >> existing matching entry in each of the tables, Persons and Files. >> >> So, what the heck am I missing? What am I doing wrong? Any help getting >> my brain around this is appreciated. >> >> Thanks >> TNF >> >> -- >> Tina Norris Fields >> tinanfields-at-torchlake-dot-com >> 231-322-2787 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From stuart at lexacorp.com.pg Wed May 4 17:18:14 2016 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 05 May 2016 08:18:14 +1000 Subject: [AccessD] Issues of many-many relationships In-Reply-To: References: , , Message-ID: <572A7526.29312.4125D56D@stuart.lexacorp.com.pg> You need to do it in two steps: 1. Create the new file 2. Associate it with the person. Write a simple VBA function to do it. On 4 May 2016 at 18:09, Tina Norris Fields wrote: > Yes, that's been my experience. But, I want to be able to create a new > file to be associated with that person, and that isn't working because > the intermediate table requires a matching entry in the primary table. > > TNF > > Tina Norris Fields > tinanfields-at-torchlake-dot-com > 231-322-2787 > > On 05/04/16 3:20 PM, jack drawbridge wrote: > > Tina, > > > > I think you first have to add the File to the tblFile, then you could > > associate that file with Person X. > > Similarly if there is a new Person, you would add the person to tblPerson > > and then associate that Person with a selected File. > > Just typing while thinking... > > good luck. > > > > On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < > > tinanfields at torchlake.com> wrote: > > > >> Hi, > >> > >> This should be easy, I'm sure, and I should know how to do it, but I'm > >> having trouble with it. > >> > >> The examples I regularly find that deal with the many-many relationship > >> are a bunch like this: > >> > >> Students --> Student-Class <-- Classes > >> > >> Where students may take several classes and classes may have several > >> students, so, we create a details or junction table, containing the FK for > >> student and FK for class - giving us one record for each combination of > >> student-and-class. Great! But, this depends on existing data in both the > >> Students table and the Classes table. > >> > >> Now, I'm dealing with a slightly different case. I have a table of > >> Persons and a table of their Files. Each Person could have several Files, > >> and each File could apply to several Persons. (As an example, one File > >> could be estate planning for a married couple, so the file applies to two > >> individuals.) Clearly, this is a many-many relationship, requiring a > >> junction table. > >> > >> Persons --> Person-File <-- Files > >> > >> No problem creating a query to display the files pertaining to any one > >> person. But, from here, how to create a new File for an existing Person? > >> The Person-File table cannot have a new entry, because it requires an > >> existing matching entry in each of the tables, Persons and Files. > >> > >> So, what the heck am I missing? What am I doing wrong? Any help getting > >> my brain around this is appreciated. > >> > >> Thanks > >> TNF > >> > >> -- > >> Tina Norris Fields > >> tinanfields-at-torchlake-dot-com > >> 231-322-2787 > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DMcGillivray at ctc.ca.gov Wed May 4 18:08:46 2016 From: DMcGillivray at ctc.ca.gov (McGillivray, Don) Date: Wed, 4 May 2016 23:08:46 +0000 Subject: [AccessD] Issues of many-many relationships In-Reply-To: References: Message-ID: Hi Tina, I generally think of many-to-many relationships as being defined by circumstance. That is, the records on either side of the junction exist independently of each other and are caused to relate to each other depending on a specific condition. To take your example of the class and students, the classes and students exist independently of each other and are related only through the condition of a student choosing to be enrolled in the class. The problem you're trying to solve is different, in that, presumably, a file does not exist except in relation to a specific person or persons. It's not just a generic entity sitting out there waiting to be joined to one or more persons by virtue of some heretofore unforeseen circumstance. (Unless I misunderstand your problem.) So, perhaps the file record can be created as the direct child of a primary person record, and then shared with one or more other persons using the many-to-many junction. Or maybe the person records are related to a common parent record (family, couple, group, etc.) and the file record is related to the parent record instead of individual person records. Maybe these thoughts will inspire you toward another more effective solution. Don -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tina Norris Fields Sent: Wednesday, May 04, 2016 3:10 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Issues of many-many relationships Yes, that's been my experience. But, I want to be able to create a new file to be associated with that person, and that isn't working because the intermediate table requires a matching entry in the primary table. TNF Tina Norris Fields tinanfields-at-torchlake-dot-com 231-322-2787 On 05/04/16 3:20 PM, jack drawbridge wrote: > Tina, > > I think you first have to add the File to the tblFile, then you could > associate that file with Person X. > Similarly if there is a new Person, you would add the person to > tblPerson and then associate that Person with a selected File. > Just typing while thinking... > good luck. > > On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < > tinanfields at torchlake.com> wrote: > >> Hi, >> >> This should be easy, I'm sure, and I should know how to do it, but >> I'm having trouble with it. >> >> The examples I regularly find that deal with the many-many >> relationship are a bunch like this: >> >> Students --> Student-Class <-- Classes >> >> Where students may take several classes and classes may have several >> students, so, we create a details or junction table, containing the >> FK for student and FK for class - giving us one record for each >> combination of student-and-class. Great! But, this depends on >> existing data in both the Students table and the Classes table. >> >> Now, I'm dealing with a slightly different case. I have a table of >> Persons and a table of their Files. Each Person could have several >> Files, and each File could apply to several Persons. (As an example, >> one File could be estate planning for a married couple, so the file >> applies to two >> individuals.) Clearly, this is a many-many relationship, requiring a >> junction table. >> >> Persons --> Person-File <-- Files >> >> No problem creating a query to display the files pertaining to any >> one person. But, from here, how to create a new File for an existing Person? >> The Person-File table cannot have a new entry, because it requires an >> existing matching entry in each of the tables, Persons and Files. >> >> So, what the heck am I missing? What am I doing wrong? Any help >> getting my brain around this is appreciated. >> >> Thanks >> TNF >> >> -- >> Tina Norris Fields >> tinanfields-at-torchlake-dot-com >> 231-322-2787 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jbodin at sbor.com Wed May 4 19:03:20 2016 From: jbodin at sbor.com (John Bodin) Date: Thu, 5 May 2016 00:03:20 +0000 Subject: [AccessD] Microsoft Access Application to Record, Organize, and Prioritize IT Requests from other Departments In-Reply-To: References: <832526796.18798345.1380643351154.JavaMail.root@cds002> Message-ID: Brad, if you are talking along the lines of a help desk, can't beat Spiceworks for that. Free and full featured and always evolving. Assign tickets, create sub-tickets, track time and billable rates, auto-responses, front-end for people to track their own tickets, document reference site, etc. Also, if you have multiple sites, you can install Spiceworks everywhere and make them data collection sites. They will roll up requests into the master site, wherever that is located. New full web-based out now as well as on-premises install that has a lot of other features. If you are talking more along the lines of project management, you might take a look at Asana. Free to try but not sure how much they grab you for per user after that. Good luck, John -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Wednesday, May 04, 2016 5:16 PM To: Access Developers discussion and problem solving Subject: [AccessD] Microsoft Access Application to Record, Organize, and Prioritize IT Requests from other Departments All, A friend who works for another small firm (50 employees) recently asked me if I knew of any inexpensive (or free) system that could be used to Record, Organize, and Prioritize IT Requests from other Departments. I am curious if there is a Microsoft Access template for such use or perhaps a small system that someone else has developed for this purpose. I have looked at the Access templates but have not found a good fit yet. Any ideas or suggestions would be appreciated. Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Wed May 4 20:32:38 2016 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Wed, 4 May 2016 18:32:38 -0700 Subject: [AccessD] Importing XLSX In-Reply-To: References: Message-ID: <65AF64093A834C8EBAF28FBB92B58F8A@HAL9007> Sorry Bill. No offense intended. Life is a bit crazy now - moved twice in the last three months. But not an excuse to overlook acknowledging your post. r -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Wednesday, May 04, 2016 1:42 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Importing XLSX In what way did my suggestion not satisfy or not even deserve a thanks but no thanks Rocky? Payback for my inattention to one of your own replies in the past? On May 4, 2016 4:12 PM, "Rocky Smolin" wrote: > Lambert: > > Thanks for your reply. I'm pretty sure I have the compatibility pack > installed because I can open xlsx files with Excel 2003 but I > downloaded and installed anyway. However, I still got the 'not in the > expected format' > message when using TransferSpreadsheet. > > I have to talk to the client to see if they can provide a .CSV file - > that would work around the problem altogether. > > Barring that, perhaps I can open the spreadsheet directly and process > it that way. > > Best, > > Rocky > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Heenan, Lambert > Sent: Wednesday, May 04, 2016 11:37 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Importing XLSX > > It's been a while, so I don't exactly remember, but I think that if > you install the MS Office Compatibility Pack, then Access will be able > to read .xlsx files. The SW is available here... > > https://www.microsoft.com/en-us/download/details.aspx?id=3 > > > Lambert > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Bill Benson > Sent: Wednesday, May 04, 2016 2:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Importing XLSX > > Automate Excel through Access. If Excel 2007 and higher is your most > recently installed Excel version, that will be used to open the .xlsx > file, then saveas in code paying particular attention to both > extension and the fileformat intrinsic constant for 2003 files, which > to Excel is xlExcel8 but if you use CreateObject instead of setting a > reference to Excel, use 56. > Then use Transfer spreadsheet. > > If you have most recently installed Excel 2003, then that is what will > open the file, and it will be in Compatibility mode. Likewise do a > SaveAs, but I am not sure there was a FileFormat property back then. > If there was, it likely was not 56, it might have been some number in the 4000's. > On May 4, 2016 11:32 AM, "Rocky Smolin" wrote: > > Dear List: > > I'm still using 2003 for development - should probably up to 2010. > However... > > I have an app which requires processing data from XL spreadsheets. My > usual method is to use TransferSpreadsheet into a front end table and > process the records from there. > > However, TransferSpreadsheet doesn't seem to like xlsx format. If I > save the file as xls, no problem. > > Is there a way to use TransferSpreadsheet on an xlsx file in A2003? > > MTIA > > Rocky Smolin > Beach Access Software > 760-683-5777 > www.bchacc.com www.e-z-mrp.com > > Skype: rocky.smolin > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kost36 at otenet.gr Thu May 5 02:46:11 2016 From: kost36 at otenet.gr (Kostas Konstantinidis) Date: Thu, 5 May 2016 10:46:11 +0300 Subject: [AccessD] select top and limit... Message-ID: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> Hi all, I uae "LIMIT 10" in mysql query but what I really need is get also all the equal values with the 10th record I know that ms access do it by default with "select top" but I can't make it to work in mysql Could you please help? Thank's /kostas From paul.hartland at googlemail.com Thu May 5 03:06:40 2016 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 5 May 2016 09:06:40 +0100 Subject: [AccessD] select top and limit... In-Reply-To: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> Message-ID: never used mysql and know nothing about this limit 10 (although just quickly looked it up), but if the values in the query you are setting the limit on are ascending, could you not use the limit 10 as a sub query like below...off top of head something like below and assuming the table/query has some sort of unique identifier on SELECT * FROM [yourtableorqueryhere] AS A INNER JOIN ( SELECT UniqueID, MAX([yourvaluefieldhere]) AS GetRecords ) AS B ON A.UniqueID = B.UniqueID OR A.[yourvaluefieldhere] <= B.GetRecords On 5 May 2016 at 08:46, Kostas Konstantinidis wrote: > Hi all, > I uae "LIMIT 10" in mysql query but what I really need is get also all the > equal values with the 10th record > I know that ms access do it by default with "select top" but I can't make > it to work in mysql > Could you please help? > > Thank's > /kostas > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Paul Hartland paul.hartland at googlemail.com From kost36 at otenet.gr Thu May 5 03:25:19 2016 From: kost36 at otenet.gr (Kostas Konstantinidis) Date: Thu, 5 May 2016 11:25:19 +0300 Subject: [AccessD] select top and limit... In-Reply-To: References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> Message-ID: <01cc01d1a6a7$aa545da0$fefd18e0$@otenet.gr> Hi Paul thank's for your reply This is the query which works but it doesn't return the equal values with the 10th record SELECT `T_people`.`person` AS `person`, COUNT(`ST_peoplefilms`.`ID_films`) AS `CountOfID_films` FROM ((`MT_films` JOIN `ST_peoplefilms` ON ((`MT_films`.`ID_films` = `ST_peoplefilms`.`ID_films`))) JOIN `T_people` ON ((`T_people`.`ID_person` = `ST_peoplefilms`.`ID_person`))) GROUP BY `T_people`.`person` , `T_people`.`man` , `ST_peoplefilms`.`ID_idiotita` , `MT_films`.`kind_movie` HAVING ((`T_people`.`man` = 1) AND (`MT_films`.`kind_movie` = '?.?') AND ((`ST_peoplefilms`.`ID_idiotita` = 2) OR (`ST_peoplefilms`.`ID_idiotita` = 13) OR (`ST_peoplefilms`.`ID_idiotita` = 40) OR (`ST_peoplefilms`.`ID_idiotita` = 44) OR (`ST_peoplefilms`.`ID_idiotita` = 45))) ORDER BY COUNT(`ST_peoplefilms`.`ID_films`) DESC LIMIT 10 -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Thursday, May 5, 2016 11:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] select top and limit... never used mysql and know nothing about this limit 10 (although just quickly looked it up), but if the values in the query you are setting the limit on are ascending, could you not use the limit 10 as a sub query like below...off top of head something like below and assuming the table/query has some sort of unique identifier on SELECT * FROM [yourtableorqueryhere] AS A INNER JOIN ( SELECT UniqueID, MAX([yourvaluefieldhere]) AS GetRecords ) AS B ON A.UniqueID = B.UniqueID OR A.[yourvaluefieldhere] <= B.GetRecords On 5 May 2016 at 08:46, Kostas Konstantinidis wrote: > Hi all, > I uae "LIMIT 10" in mysql query but what I really need is get also all > the equal values with the 10th record I know that ms access do it by > default with "select top" but I can't make it to work in mysql Could > you please help? > > Thank's > /kostas > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Paul Hartland paul.hartland at googlemail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu May 5 05:08:16 2016 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 05 May 2016 20:08:16 +1000 Subject: [AccessD] select top and limit... In-Reply-To: <01cc01d1a6a7$aa545da0$fefd18e0$@otenet.gr> References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr>, , <01cc01d1a6a7$aa545da0$fefd18e0$@otenet.gr> Message-ID: <572B1B90.11576.43AFE830@stuart.lexacorp.com.pg> About the only way that I can see it would be a UNION to a second query which return all the records matching the last. Something like: Select LIMIT 9 UNION Select . where CountOfID_films IN LIMIT 10,1 On 5 May 2016 at 11:25, Kostas Konstantinidis wrote: > Hi Paul thank's for your reply > This is the query which works but it doesn't return the equal values > with the 10th record > > SELECT > `T_people`.`person` AS `person`, > COUNT(`ST_peoplefilms`.`ID_films`) AS `CountOfID_films` > FROM > ((`MT_films` > JOIN `ST_peoplefilms` ON ((`MT_films`.`ID_films` = > `ST_peoplefilms`.`ID_films`))) > JOIN `T_people` ON ((`T_people`.`ID_person` = > `ST_peoplefilms`.`ID_person`))) > GROUP BY `T_people`.`person` , `T_people`.`man` , > `ST_peoplefilms`.`ID_idiotita` , `MT_films`.`kind_movie` > HAVING ((`T_people`.`man` = 1) > AND (`MT_films`.`kind_movie` = '.') > AND ((`ST_peoplefilms`.`ID_idiotita` = 2) > OR (`ST_peoplefilms`.`ID_idiotita` = 13) > OR (`ST_peoplefilms`.`ID_idiotita` = 40) > OR (`ST_peoplefilms`.`ID_idiotita` = 44) > OR (`ST_peoplefilms`.`ID_idiotita` = 45))) > ORDER BY COUNT(`ST_peoplefilms`.`ID_films`) DESC > LIMIT 10 > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Paul Hartland Sent: Thursday, May 5, 2016 11:07 AM To: Access > Developers discussion and problem solving > Subject: Re: [AccessD] select top and > limit... > > never used mysql and know nothing about this limit 10 (although just > quickly looked it up), but if the values in the query you are setting > the limit on are ascending, could you not use the limit 10 as a sub > query like below...off top of head something like below and assuming > the table/query has some sort of unique identifier on > > SELECT * > FROM [yourtableorqueryhere] AS A > INNER JOIN > ( > SELECT UniqueID, MAX([yourvaluefieldhere]) AS GetRecords > ) AS B > ON > A.UniqueID = B.UniqueID > OR > A.[yourvaluefieldhere] <= B.GetRecords > > > > > On 5 May 2016 at 08:46, Kostas Konstantinidis > wrote: > > > Hi all, > > I uae "LIMIT 10" in mysql query but what I really need is get also > > all the equal values with the 10th record I know that ms access do > > it by default with "select top" but I can't make it to work in > > mysql Could you please help? > > > > Thank's > > /kostas > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > Paul Hartland > paul.hartland at googlemail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu May 5 05:31:34 2016 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 05 May 2016 20:31:34 +1000 Subject: [AccessD] select top and limit... In-Reply-To: <572B1B90.11576.43AFE830@stuart.lexacorp.com.pg> References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr>, <01cc01d1a6a7$aa545da0$fefd18e0$@otenet.gr>, <572B1B90.11576.43AFE830@stuart.lexacorp.com.pg> Message-ID: <572B2106.10871.43C53CB5@stuart.lexacorp.com.pg> Another thought: Select where CountofID_Films >= (Select CountofID_Fims from LIMIT 10,1) On 5 May 2016 at 20:08, Stuart McLachlan wrote: > About the only way that I can see it would be > a UNION to a second query which return all the records matching the > last. Something like: > > Select LIMIT 9 > UNION > Select . > where CountOfID_films IN > LIMIT 10,1 > > > > > > On 5 May 2016 at 11:25, Kostas Konstantinidis wrote: > > > > > Hi Paul thank's for your reply > > > This is the query which works but it doesn't return the equal values > > > with the 10th record > > > > > > SELECT > > > `T_people`.`person` AS `person`, > > > COUNT(`ST_peoplefilms`.`ID_films`) AS `CountOfID_films` > > > FROM > > > ((`MT_films` > > > JOIN `ST_peoplefilms` ON ((`MT_films`.`ID_films` = > > > `ST_peoplefilms`.`ID_films`))) > > > JOIN `T_people` ON ((`T_people`.`ID_person` = > > > `ST_peoplefilms`.`ID_person`))) > > > GROUP BY `T_people`.`person` , `T_people`.`man` , > > > `ST_peoplefilms`.`ID_idiotita` , `MT_films`.`kind_movie` > > > HAVING ((`T_people`.`man` = 1) > > > AND (`MT_films`.`kind_movie` = '.') > > > AND ((`ST_peoplefilms`.`ID_idiotita` = 2) > > > OR (`ST_peoplefilms`.`ID_idiotita` = 13) > > > OR (`ST_peoplefilms`.`ID_idiotita` = 40) > > > OR (`ST_peoplefilms`.`ID_idiotita` = 44) > > > OR (`ST_peoplefilms`.`ID_idiotita` = 45))) > > > ORDER BY COUNT(`ST_peoplefilms`.`ID_films`) DESC > > > LIMIT 10 > > > > > > -----Original Message----- > > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On > > > Behalf Of Paul Hartland Sent: Thursday, May 5, 2016 11:07 AM To: > > > Access Developers discussion and problem solving > > > Subject: Re: [AccessD] select top and > > > limit... > > > > > > never used mysql and know nothing about this limit 10 (although just > > > quickly looked it up), but if the values in the query you are > > > setting the limit on are ascending, could you not use the limit 10 > > > as a sub query like below...off top of head something like below and > > > assuming the table/query has some sort of unique identifier on > > > > > > SELECT * > > > FROM [yourtableorqueryhere] AS A > > > INNER JOIN > > > ( > > > SELECT UniqueID, MAX([yourvaluefieldhere]) AS GetRecords > > > ) AS B > > > ON > > > A.UniqueID = B.UniqueID > > > OR > > > A.[yourvaluefieldhere] <= B.GetRecords > > > > > > > > > > > > > > > On 5 May 2016 at 08:46, Kostas Konstantinidis > > > wrote: > > > > > > > Hi all, > > > > I uae "LIMIT 10" in mysql query but what I really need is get also > > > > all the equal values with the 10th record I know that ms access do > > > > it by default with "select top" but I can't make it to work in > > > > mysql Could you please help? > > > > > > > > Thank's > > > > /kostas > > > > > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > > > > -- > > > Paul Hartland > > > paul.hartland at googlemail.com > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From tinanfields at torchlake.com Thu May 5 07:16:31 2016 From: tinanfields at torchlake.com (Tina Norris Fields) Date: Thu, 5 May 2016 08:16:31 -0400 Subject: [AccessD] Issues of many-many relationships In-Reply-To: <572A7526.29312.4125D56D@stuart.lexacorp.com.pg> References: <572A7526.29312.4125D56D@stuart.lexacorp.com.pg> Message-ID: <08d0272c-8dea-f485-b109-b7c08e06de97@torchlake.com> Stuart, Yes, that is what I've seen so far, but, I'm failing to see how to do that in a way that will not inconvenience the clerical person who will actually be doing the data entry. I've somehow been really dense as I look at this puzzle. TNF Tina Norris Fields tinanfields-at-torchlake-dot-com 231-322-2787 On 05/04/16 6:18 PM, Stuart McLachlan wrote: > You need to do it in two steps: > 1. Create the new file > 2. Associate it with the person. > > Write a simple VBA function to do it. > > On 4 May 2016 at 18:09, Tina Norris Fields wrote: > >> Yes, that's been my experience. But, I want to be able to create a new >> file to be associated with that person, and that isn't working because >> the intermediate table requires a matching entry in the primary table. >> >> TNF >> >> Tina Norris Fields >> tinanfields-at-torchlake-dot-com >> 231-322-2787 >> >> On 05/04/16 3:20 PM, jack drawbridge wrote: >>> Tina, >>> >>> I think you first have to add the File to the tblFile, then you could >>> associate that file with Person X. >>> Similarly if there is a new Person, you would add the person to tblPerson >>> and then associate that Person with a selected File. >>> Just typing while thinking... >>> good luck. >>> >>> On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < >>> tinanfields at torchlake.com> wrote: >>> >>>> Hi, >>>> >>>> This should be easy, I'm sure, and I should know how to do it, but I'm >>>> having trouble with it. >>>> >>>> The examples I regularly find that deal with the many-many relationship >>>> are a bunch like this: >>>> >>>> Students --> Student-Class <-- Classes >>>> >>>> Where students may take several classes and classes may have several >>>> students, so, we create a details or junction table, containing the FK for >>>> student and FK for class - giving us one record for each combination of >>>> student-and-class. Great! But, this depends on existing data in both the >>>> Students table and the Classes table. >>>> >>>> Now, I'm dealing with a slightly different case. I have a table of >>>> Persons and a table of their Files. Each Person could have several Files, >>>> and each File could apply to several Persons. (As an example, one File >>>> could be estate planning for a married couple, so the file applies to two >>>> individuals.) Clearly, this is a many-many relationship, requiring a >>>> junction table. >>>> >>>> Persons --> Person-File <-- Files >>>> >>>> No problem creating a query to display the files pertaining to any one >>>> person. But, from here, how to create a new File for an existing Person? >>>> The Person-File table cannot have a new entry, because it requires an >>>> existing matching entry in each of the tables, Persons and Files. >>>> >>>> So, what the heck am I missing? What am I doing wrong? Any help getting >>>> my brain around this is appreciated. >>>> >>>> Thanks >>>> TNF >>>> >>>> -- >>>> Tina Norris Fields >>>> tinanfields-at-torchlake-dot-com >>>> 231-322-2787 >>>> >>>> -- >>>> AccessD mailing list >>>> AccessD at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/accessd >>>> Website: http://www.databaseadvisors.com >>>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From mwp.reid at qub.ac.uk Thu May 5 07:23:35 2016 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Thu, 5 May 2016 12:23:35 +0000 Subject: [AccessD] OT Excel Message-ID: <976E500DD0AF35409874A413967BFAEC79C1BD8C@EX2K10-MBX6.ads.qub.ac.uk> As a last resort We export 2 feels from our Oracle student system and import them into CRM. Our code tells us the files are Excel 1996 and we need a later version. Of course our Oracle people tell us they are not 1996. Is there anything that can with 100% accuracy identify the correct version of the source files in terms of Excel version? Martin From mwp.reid at qub.ac.uk Thu May 5 07:27:21 2016 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Thu, 5 May 2016 12:27:21 +0000 Subject: [AccessD] OT Excel In-Reply-To: <976E500DD0AF35409874A413967BFAEC79C1BD8C@EX2K10-MBX6.ads.qub.ac.uk> References: <976E500DD0AF35409874A413967BFAEC79C1BD8C@EX2K10-MBX6.ads.qub.ac.uk> Message-ID: <976E500DD0AF35409874A413967BFAEC79C1BDF3@EX2K10-MBX6.ads.qub.ac.uk> Files not feels!!!!!!!!!! Some things never change like my spelling!! Martin -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin Reid Sent: 05 May 2016 13:24 To: Access Developers discussion and problem solving Subject: [AccessD] OT Excel As a last resort We export 2 feels from our Oracle student system and import them into CRM. Our code tells us the files are Excel 1996 and we need a later version. Of course our Oracle people tell us they are not 1996. Is there anything that can with 100% accuracy identify the correct version of the source files in terms of Excel version? Martin -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From tinanfields at torchlake.com Thu May 5 07:29:48 2016 From: tinanfields at torchlake.com (Tina Norris Fields) Date: Thu, 5 May 2016 08:29:48 -0400 Subject: [AccessD] Issues of many-many relationships In-Reply-To: References: Message-ID: <22323e66-fe83-61a8-d4a9-39d8dad81a36@torchlake.com> Don, You have understood the matter correctly. It is precisely because the files are not independent entities that I am hitting a wall. To check that I am understanding your suggestion - are you saying that each file would have a principal person as part of its definition? That's, of course, what I'd do if there were a one-to-many relationship of Person-to-File. Then, any additionally associated persons would be connected via the junction table. Hmm - that might work well. Thanks for the thought. I would also love to be able to use my household structure for this, wherein each person is a member of a household. But, the client could be a single individual in the household rather than the entire household. TNF Tina Norris Fields tinanfields-at-torchlake-dot-com 231-322-2787 On 05/04/16 7:08 PM, McGillivray, Don wrote: > Hi Tina, > > I generally think of many-to-many relationships as being defined by circumstance. That is, the records on either side of the junction exist independently of each other and are caused to relate to each other depending on a specific condition. To take your example of the class and students, the classes and students exist independently of each other and are related only through the condition of a student choosing to be enrolled in the class. > > The problem you're trying to solve is different, in that, presumably, a file does not exist except in relation to a specific person or persons. It's not just a generic entity sitting out there waiting to be joined to one or more persons by virtue of some heretofore unforeseen circumstance. (Unless I misunderstand your problem.) > > So, perhaps the file record can be created as the direct child of a primary person record, and then shared with one or more other persons using the many-to-many junction. Or maybe the person records are related to a common parent record (family, couple, group, etc.) and the file record is related to the parent record instead of individual person records. > > Maybe these thoughts will inspire you toward another more effective solution. > > Don > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tina Norris Fields > Sent: Wednesday, May 04, 2016 3:10 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Issues of many-many relationships > > Yes, that's been my experience. But, I want to be able to create a new file to be associated with that person, and that isn't working because the intermediate table requires a matching entry in the primary table. > > TNF > > Tina Norris Fields > tinanfields-at-torchlake-dot-com > 231-322-2787 > > On 05/04/16 3:20 PM, jack drawbridge wrote: >> Tina, >> >> I think you first have to add the File to the tblFile, then you could >> associate that file with Person X. >> Similarly if there is a new Person, you would add the person to >> tblPerson and then associate that Person with a selected File. >> Just typing while thinking... >> good luck. >> >> On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < >> tinanfields at torchlake.com> wrote: >> >>> Hi, >>> >>> This should be easy, I'm sure, and I should know how to do it, but >>> I'm having trouble with it. >>> >>> The examples I regularly find that deal with the many-many >>> relationship are a bunch like this: >>> >>> Students --> Student-Class <-- Classes >>> >>> Where students may take several classes and classes may have several >>> students, so, we create a details or junction table, containing the >>> FK for student and FK for class - giving us one record for each >>> combination of student-and-class. Great! But, this depends on >>> existing data in both the Students table and the Classes table. >>> >>> Now, I'm dealing with a slightly different case. I have a table of >>> Persons and a table of their Files. Each Person could have several >>> Files, and each File could apply to several Persons. (As an example, >>> one File could be estate planning for a married couple, so the file >>> applies to two >>> individuals.) Clearly, this is a many-many relationship, requiring a >>> junction table. >>> >>> Persons --> Person-File <-- Files >>> >>> No problem creating a query to display the files pertaining to any >>> one person. But, from here, how to create a new File for an existing Person? >>> The Person-File table cannot have a new entry, because it requires an >>> existing matching entry in each of the tables, Persons and Files. >>> >>> So, what the heck am I missing? What am I doing wrong? Any help >>> getting my brain around this is appreciated. >>> >>> Thanks >>> TNF >>> >>> -- >>> Tina Norris Fields >>> tinanfields-at-torchlake-dot-com >>> 231-322-2787 >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jimdettman at verizon.net Thu May 5 07:41:56 2016 From: jimdettman at verizon.net (Jim Dettman) Date: Thu, 05 May 2016 08:41:56 -0400 Subject: [AccessD] Issues of many-many relationships In-Reply-To: <08d0272c-8dea-f485-b109-b7c08e06de97@torchlake.com> References: <572A7526.29312.4125D56D@stuart.lexacorp.com.pg> <08d0272c-8dea-f485-b109-b7c08e06de97@torchlake.com> Message-ID: <21AE4B9467364BFCA9AB60F875B14D37@XPS> This might help a bit (or may not) and I may be saying things you already know or has been said as I'm late to the discussion, but here goes. In Access, you can't directly model a many to many relationship in forms. The best you can do is handle each side of the relationship, which is a one to many with a main/subform combo. Main form is bound to the one (say persons) and the subform handles the many (person-file). A combo control in the subform allows you to choose the one from the other side of the many to many (a file). You can also look at it from the other side of the M-M relationship: Main form is bound to the one (file) and the subform handles the many (person-file). A combo control in the subform then allows you to choose the person. For data entry, you can: 1. Allow the user to switch back and forth between these two forms to add new records. 2. Have one or the other (or even both), but when using the combo in the subform, use the not-in-list event to pop-up a form to add a new record (in the first case above, add a new file to be chosen in the combo), requery the combo, and your off and running. 3. Use a un-bound main form, then a subform for each of the forms above, each of which will have a subform in it for the many. The last I've found is very confusing for users. I like #2 the best. I like to provide both combinations of the main/subform's and then let them choose which side of the M-M they want to work from. Depending on the task or the process they are walking through, it may be one or the other at different times. HTH, Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tina Norris Fields Sent: Thursday, May 05, 2016 08:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Issues of many-many relationships Stuart, Yes, that is what I've seen so far, but, I'm failing to see how to do that in a way that will not inconvenience the clerical person who will actually be doing the data entry. I've somehow been really dense as I look at this puzzle. TNF Tina Norris Fields tinanfields-at-torchlake-dot-com 231-322-2787 On 05/04/16 6:18 PM, Stuart McLachlan wrote: > You need to do it in two steps: > 1. Create the new file > 2. Associate it with the person. > > Write a simple VBA function to do it. > > On 4 May 2016 at 18:09, Tina Norris Fields wrote: > >> Yes, that's been my experience. But, I want to be able to create a new >> file to be associated with that person, and that isn't working because >> the intermediate table requires a matching entry in the primary table. >> >> TNF >> >> Tina Norris Fields >> tinanfields-at-torchlake-dot-com >> 231-322-2787 >> >> On 05/04/16 3:20 PM, jack drawbridge wrote: >>> Tina, >>> >>> I think you first have to add the File to the tblFile, then you could >>> associate that file with Person X. >>> Similarly if there is a new Person, you would add the person to tblPerson >>> and then associate that Person with a selected File. >>> Just typing while thinking... >>> good luck. >>> >>> On Wed, May 4, 2016 at 3:07 PM, Tina Norris Fields < >>> tinanfields at torchlake.com> wrote: >>> >>>> Hi, >>>> >>>> This should be easy, I'm sure, and I should know how to do it, but I'm >>>> having trouble with it. >>>> >>>> The examples I regularly find that deal with the many-many relationship >>>> are a bunch like this: >>>> >>>> Students --> Student-Class <-- Classes >>>> >>>> Where students may take several classes and classes may have several >>>> students, so, we create a details or junction table, containing the FK for >>>> student and FK for class - giving us one record for each combination of >>>> student-and-class. Great! But, this depends on existing data in both the >>>> Students table and the Classes table. >>>> >>>> Now, I'm dealing with a slightly different case. I have a table of >>>> Persons and a table of their Files. Each Person could have several Files, >>>> and each File could apply to several Persons. (As an example, one File >>>> could be estate planning for a married couple, so the file applies to two >>>> individuals.) Clearly, this is a many-many relationship, requiring a >>>> junction table. >>>> >>>> Persons --> Person-File <-- Files >>>> >>>> No problem creating a query to display the files pertaining to any one >>>> person. But, from here, how to create a new File for an existing Person? >>>> The Person-File table cannot have a new entry, because it requires an >>>> existing matching entry in each of the tables, Persons and Files. >>>> >>>> So, what the heck am I missing? What am I doing wrong? Any help getting >>>> my brain around this is appreciated. >>>> >>>> Thanks >>>> TNF >>>> >>>> -- >>>> Tina Norris Fields >>>> tinanfields-at-torchlake-dot-com >>>> 231-322-2787 >>>> >>>> -- >>>> AccessD mailing list >>>> AccessD at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/accessd >>>> Website: http://www.databaseadvisors.com >>>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kost36 at otenet.gr Thu May 5 08:37:48 2016 From: kost36 at otenet.gr (Kostas Konstantinidis) Date: Thu, 5 May 2016 16:37:48 +0300 Subject: [AccessD] select top and limit... In-Reply-To: References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> <01cc01d1a6a7$aa545da0$fefd18e0$@otenet.gr> <572B1B90.11576.43AFE830@stuart.lexacorp.com.pg> <572B2106.10871.43C53CB5@stuart.lexacorp.com.pg> Message-ID: <01da01d1a6d3$52825b00$f7871100$@otenet.gr> Hi Hack, There are a lot of queries there, but as is seems nothing fits in the case I am looking for Anyway Thank's a lot /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jack drawbridge Sent: Thursday, May 5, 2016 2:07 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] select top and limit... There is a sample (found via Google and *not* tested by me) of MySQL ranking query with ties at http://fellowtuts.com/mysql/query-to-obtain-rank-function-in-mysql/ Hope it is useful. On Thu, May 5, 2016 at 6:31 AM, Stuart McLachlan wrote: > Another thought: > > Select where CountofID_Films >= (Select CountofID_Fims > from LIMIT 10,1) > > On 5 May 2016 at 20:08, Stuart McLachlan wrote: > > > About the only way that I can see it would be a UNION to a second > > query which return all the records matching the last. Something > > like: > > > > Select LIMIT 9 > > UNION > > Select . > > where CountOfID_films IN > > LIMIT 10,1 On 5 May 2016 at 11:25, Kostas Konstantinidis wrote: > Hi Paul thank's for your reply > This is the query which works but it doesn't return the equal values > with the 10th record > > SELECT > `T_people`.`person` AS `person`, > COUNT(`ST_peoplefilms`.`ID_films`) AS `CountOfID_films` > FROM > ((`MT_films` > JOIN `ST_peoplefilms` ON ((`MT_films`.`ID_films` = > `ST_peoplefilms`.`ID_films`))) > JOIN `T_people` ON ((`T_people`.`ID_person` = > `ST_peoplefilms`.`ID_person`))) > GROUP BY `T_people`.`person` , `T_people`.`man` , > `ST_peoplefilms`.`ID_idiotita` , `MT_films`.`kind_movie` > HAVING ((`T_people`.`man` = 1) > AND (`MT_films`.`kind_movie` = '.') > AND ((`ST_peoplefilms`.`ID_idiotita` = 2) > OR (`ST_peoplefilms`.`ID_idiotita` = 13) > OR (`ST_peoplefilms`.`ID_idiotita` = 40) > OR (`ST_peoplefilms`.`ID_idiotita` = 44) > OR (`ST_peoplefilms`.`ID_idiotita` = 45))) > ORDER BY COUNT(`ST_peoplefilms`.`ID_films`) DESC > LIMIT 10 > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Paul Hartland Sent: Thursday, May 5, 2016 11:07 AM To: Access > Developers discussion and problem solving > Subject: Re: [AccessD] select top and > limit... > > never used mysql and know nothing about this limit 10 (although just > quickly looked it up), but if the values in the query you are setting > the limit on are ascending, could you not use the limit 10 as a sub > query like below...off top of head something like below and assuming > the table/query has some sort of unique identifier on > > SELECT * > FROM [yourtableorqueryhere] AS A > INNER JOIN > ( > SELECT UniqueID, MAX([yourvaluefieldhere]) AS GetRecords > ) AS B > ON > A.UniqueID = B.UniqueID > OR > A.[yourvaluefieldhere] <= B.GetRecords > > > > > On 5 May 2016 at 08:46, Kostas Konstantinidis > wrote: > > > Hi all, > > I uae "LIMIT 10" in mysql query but what I really need is get also > > all the equal values with the 10th record I know that ms access do > > it by default with "select top" but I can't make it to work in > > mysql Could you please help? > > > > Thank's > > /kostas > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > Paul Hartland > paul.hartland at googlemail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at aig.com Thu May 5 10:59:36 2016 From: Lambert.Heenan at aig.com (Heenan, Lambert) Date: Thu, 5 May 2016 15:59:36 +0000 Subject: [AccessD] select top and limit... In-Reply-To: <01df01d1a6e2$89255540$9b6fffc0$@otenet.gr> References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> <01df01d1a6e2$89255540$9b6fffc0$@otenet.gr> Message-ID: Hmm. Don't know if MySQL supports the use of "With" like this (Oracle syntax)... With OLTop as ( Select OrderedList.MyValue from OrderedList Limit 10 ) Select OrderedList.MyValue from OrderedList inner join OLTop on OLtop.MyValue = OrderedList.MyValue Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 11:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Hi Lambert, I get ERROR 1235 : This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' Thank;s /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 4:55 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Kostas, OTTOMH... Select OrderedList.MyValue from OrderedList Where OrderedList.MyValue In (Select OrderedList.MyValue from OrderedList Limit 10); Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 3:46 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] select top and limit... Hi all, I uae "LIMIT 10" in mysql query but what I really need is get also all the equal values with the 10th record I know that ms access do it by default with "select top" but I can't make it to work in mysql Could you please help? Thank's /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kost36 at otenet.gr Thu May 5 11:40:44 2016 From: kost36 at otenet.gr (Kostas Konstantinidis) Date: Thu, 5 May 2016 19:40:44 +0300 Subject: [AccessD] select top and limit... In-Reply-To: References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> <01df01d1a6e2$89255540$9b6fffc0$@otenet.gr> Message-ID: <01e801d1a6ec$dfcb7280$9f625780$@otenet.gr> It doesn't /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 7:00 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Hmm. Don't know if MySQL supports the use of "With" like this (Oracle syntax)... With OLTop as ( Select OrderedList.MyValue from OrderedList Limit 10 ) Select OrderedList.MyValue from OrderedList inner join OLTop on OLtop.MyValue = OrderedList.MyValue Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 11:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Hi Lambert, I get ERROR 1235 : This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' Thank;s /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 4:55 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Kostas, OTTOMH... Select OrderedList.MyValue from OrderedList Where OrderedList.MyValue In (Select OrderedList.MyValue from OrderedList Limit 10); Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 3:46 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] select top and limit... Hi all, I uae "LIMIT 10" in mysql query but what I really need is get also all the equal values with the 10th record I know that ms access do it by default with "select top" but I can't make it to work in mysql Could you please help? Thank's /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at aig.com Thu May 5 11:53:03 2016 From: Lambert.Heenan at aig.com (Heenan, Lambert) Date: Thu, 5 May 2016 16:53:03 +0000 Subject: [AccessD] select top and limit... In-Reply-To: <01e801d1a6ec$dfcb7280$9f625780$@otenet.gr> References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> <01df01d1a6e2$89255540$9b6fffc0$@otenet.gr> <01e801d1a6ec$dfcb7280$9f625780$@otenet.gr> Message-ID: Google...Google... Looks like you can do this... Select * from (Select OrderedList.MyValue from OrderedList Limit 10) TopL Inner join (Select OrderedList.MyValue, [ and any other fields you want to see] from OrderedList) AllData On TopL.MyValue = AllData.MyValue; See http://stackoverflow.com/questions/13400726/mysql-combine-two-queries Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 12:41 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... It doesn't /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 7:00 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Hmm. Don't know if MySQL supports the use of "With" like this (Oracle syntax)... With OLTop as ( Select OrderedList.MyValue from OrderedList Limit 10 ) Select OrderedList.MyValue from OrderedList inner join OLTop on OLtop.MyValue = OrderedList.MyValue Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 11:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Hi Lambert, I get ERROR 1235 : This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' Thank;s /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 4:55 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Kostas, OTTOMH... Select OrderedList.MyValue from OrderedList Where OrderedList.MyValue In (Select OrderedList.MyValue from OrderedList Limit 10); Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 3:46 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] select top and limit... Hi all, I uae "LIMIT 10" in mysql query but what I really need is get also all the equal values with the 10th record I know that ms access do it by default with "select top" but I can't make it to work in mysql Could you please help? Thank's /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu May 5 12:57:47 2016 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 5 May 2016 17:57:47 +0000 Subject: [AccessD] Join Issue Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> The following sql throws and error of Join Expression not Supported. I don't think I have a syntax error so am I trying to do the impossible/forbidden? When using actual table and query names it ran fine. Thank you for your assistance. Function Injectors_around_Completion_in_Activated_Pattern() Dim strSQL As String strSQL = "SELECT RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "FROM (RS1 INNER JOIN ConfigMaster ON RS1![Other Patterns Completion is in]= ConfigMaster.PID) " & _ "INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2!Well_API_14 " & _ "WHERE (((RS2![RBI Cum]) > 0)) " & _ "GROUP BY RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "ORDER BY RS1!PatternName DESC , RS1![Completion in Pattern], ConfigMaster.ChildPID;" Set RS3 = MyDB.OpenRecordset(strSQL) End Function From kost36 at otenet.gr Thu May 5 13:01:32 2016 From: kost36 at otenet.gr (Kostas Konstantinidis) Date: Thu, 5 May 2016 21:01:32 +0300 Subject: [AccessD] select top and limit... In-Reply-To: References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr> <01df01d1a6e2$89255540$9b6fffc0$@otenet.gr> <01e801d1a6ec$dfcb7280$9f625780$@otenet.gr> Message-ID: <000601d1a6f8$29a403d0$7cec0b70$@otenet.gr> I'll try this http://stackoverflow.com/questions/8428641/views-select-contains-a-subquery- in-the-from-clause take a look I also made a question on stackover /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 7:53 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Google...Google... Looks like you can do this... Select * from (Select OrderedList.MyValue from OrderedList Limit 10) TopL Inner join (Select OrderedList.MyValue, [ and any other fields you want to see] from OrderedList) AllData On TopL.MyValue = AllData.MyValue; See http://stackoverflow.com/questions/13400726/mysql-combine-two-queries Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 12:41 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... It doesn't /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 7:00 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Hmm. Don't know if MySQL supports the use of "With" like this (Oracle syntax)... With OLTop as ( Select OrderedList.MyValue from OrderedList Limit 10 ) Select OrderedList.MyValue from OrderedList inner join OLTop on OLtop.MyValue = OrderedList.MyValue Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 11:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Hi Lambert, I get ERROR 1235 : This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' Thank;s /kostas -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 5, 2016 4:55 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] select top and limit... Kostas, OTTOMH... Select OrderedList.MyValue from OrderedList Where OrderedList.MyValue In (Select OrderedList.MyValue from OrderedList Limit 10); Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Thursday, May 05, 2016 3:46 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] select top and limit... Hi all, I uae "LIMIT 10" in mysql query but what I really need is get also all the equal values with the 10th record I know that ms access do it by default with "select top" but I can't make it to work in mysql Could you please help? Thank's /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at aig.com Thu May 5 13:29:58 2016 From: Lambert.Heenan at aig.com (Heenan, Lambert) Date: Thu, 5 May 2016 18:29:58 +0000 Subject: [AccessD] Join Issue In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> Message-ID: In your join statements you are using Bang! Instead of dot. Try... RS1 INNER JOIN ConfigMaster ON RS1.[Other Patterns Completion is in]= ConfigMaster.PID And INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2.Well_API_14 Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Thursday, May 05, 2016 1:58 PM To: Access Developers discussion and problem solving Subject: [AccessD] Join Issue The following sql throws and error of Join Expression not Supported. I don't think I have a syntax error so am I trying to do the impossible/forbidden? When using actual table and query names it ran fine. Thank you for your assistance. Function Injectors_around_Completion_in_Activated_Pattern() Dim strSQL As String strSQL = "SELECT RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "FROM (RS1 INNER JOIN ConfigMaster ON RS1![Other Patterns Completion is in]= ConfigMaster.PID) " & _ "INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2!Well_API_14 " & _ "WHERE (((RS2![RBI Cum]) > 0)) " & _ "GROUP BY RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "ORDER BY RS1!PatternName DESC , RS1![Completion in Pattern], ConfigMaster.ChildPID;" Set RS3 = MyDB.OpenRecordset(strSQL) End Function -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DMcGillivray at ctc.ca.gov Thu May 5 13:30:26 2016 From: DMcGillivray at ctc.ca.gov (McGillivray, Don) Date: Thu, 5 May 2016 18:30:26 +0000 Subject: [AccessD] Join Issue In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> Message-ID: Hi Chester, I think your problem is the use of the ! separator between your table and column name in the JOIN clauses. Looks like maybe you can get away with that in the SELECT clause, but not in the JOIN. I have no idea whether it's a "best practice" or not, but I never use the ! separator anywhere in SQL. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Thursday, May 05, 2016 10:58 AM To: Access Developers discussion and problem solving Subject: [AccessD] Join Issue The following sql throws and error of Join Expression not Supported. I don't think I have a syntax error so am I trying to do the impossible/forbidden? When using actual table and query names it ran fine. Thank you for your assistance. Function Injectors_around_Completion_in_Activated_Pattern() Dim strSQL As String strSQL = "SELECT RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "FROM (RS1 INNER JOIN ConfigMaster ON RS1![Other Patterns Completion is in]= ConfigMaster.PID) " & _ "INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2!Well_API_14 " & _ "WHERE (((RS2![RBI Cum]) > 0)) " & _ "GROUP BY RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "ORDER BY RS1!PatternName DESC , RS1![Completion in Pattern], ConfigMaster.ChildPID;" Set RS3 = MyDB.OpenRecordset(strSQL) End Function -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu May 5 13:41:21 2016 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 5 May 2016 18:41:21 +0000 Subject: [AccessD] Join Issue In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32774@HOUEX11.kindermorgan.com> I now get a new message of The Microsoft Access Database engine cannot find the input table or query RS1. RS1 is dimmed as a public recordset (Public RS1 As recordset). I use a set statement with RS1 after creating it. Set RS1 = MyDB.OpenRecordset(strSQL) Thanks for your assistance. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 05, 2016 1:30 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Join Issue In your join statements you are using Bang! Instead of dot. Try... RS1 INNER JOIN ConfigMaster ON RS1.[Other Patterns Completion is in]= ConfigMaster.PID And INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2.Well_API_14 Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Thursday, May 05, 2016 1:58 PM To: Access Developers discussion and problem solving Subject: [AccessD] Join Issue The following sql throws and error of Join Expression not Supported. I don't think I have a syntax error so am I trying to do the impossible/forbidden? When using actual table and query names it ran fine. Thank you for your assistance. Function Injectors_around_Completion_in_Activated_Pattern() Dim strSQL As String strSQL = "SELECT RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "FROM (RS1 INNER JOIN ConfigMaster ON RS1![Other Patterns Completion is in]= ConfigMaster.PID) " & _ "INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2!Well_API_14 " & _ "WHERE (((RS2![RBI Cum]) > 0)) " & _ "GROUP BY RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "ORDER BY RS1!PatternName DESC , RS1![Completion in Pattern], ConfigMaster.ChildPID;" Set RS3 = MyDB.OpenRecordset(strSQL) End Function -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at aig.com Thu May 5 13:49:53 2016 From: Lambert.Heenan at aig.com (Heenan, Lambert) Date: Thu, 5 May 2016 18:49:53 +0000 Subject: [AccessD] Join Issue In-Reply-To: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32774@HOUEX11.kindermorgan.com> References: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32774@HOUEX11.kindermorgan.com> Message-ID: Ah well that's a whole other problem. Recordsets, dimmed as DAO.Recordset or ADO.Recordset are used in VBA code, not in the SQL of queries. Then you run a query you need to use the actual tables, or named queries. SQL knows nothing about VBA (with the exception that MS Access's JET DBMS can call out to VBA to get the return value of a function). So save the SQL text in your variable strSQL as an actual query and then you can write another query that joins it to ConfigMaster (assuming that is a table or query). Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Thursday, May 05, 2016 2:41 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Join Issue I now get a new message of The Microsoft Access Database engine cannot find the input table or query RS1. RS1 is dimmed as a public recordset (Public RS1 As recordset). I use a set statement with RS1 after creating it. Set RS1 = MyDB.OpenRecordset(strSQL) Thanks for your assistance. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 05, 2016 1:30 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Join Issue In your join statements you are using Bang! Instead of dot. Try... RS1 INNER JOIN ConfigMaster ON RS1.[Other Patterns Completion is in]= ConfigMaster.PID And INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2.Well_API_14 Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Thursday, May 05, 2016 1:58 PM To: Access Developers discussion and problem solving Subject: [AccessD] Join Issue The following sql throws and error of Join Expression not Supported. I don't think I have a syntax error so am I trying to do the impossible/forbidden? When using actual table and query names it ran fine. Thank you for your assistance. Function Injectors_around_Completion_in_Activated_Pattern() Dim strSQL As String strSQL = "SELECT RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "FROM (RS1 INNER JOIN ConfigMaster ON RS1![Other Patterns Completion is in]= ConfigMaster.PID) " & _ "INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2!Well_API_14 " & _ "WHERE (((RS2![RBI Cum]) > 0)) " & _ "GROUP BY RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "ORDER BY RS1!PatternName DESC , RS1![Completion in Pattern], ConfigMaster.ChildPID;" Set RS3 = MyDB.OpenRecordset(strSQL) End Function -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu May 5 15:29:17 2016 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 5 May 2016 20:29:17 +0000 Subject: [AccessD] Join Issue In-Reply-To: References: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32710@HOUEX11.kindermorgan.com> <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB32774@HOUEX11.kindermorgan.com> Message-ID: <8E16E03987F1FD4FB0A9BEBF7CC160CB1AB33834@HOUEX11.kindermorgan.com> Thank you for the explanation. I can get it from here. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 05, 2016 1:50 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Join Issue Ah well that's a whole other problem. Recordsets, dimmed as DAO.Recordset or ADO.Recordset are used in VBA code, not in the SQL of queries. Then you run a query you need to use the actual tables, or named queries. SQL knows nothing about VBA (with the exception that MS Access's JET DBMS can call out to VBA to get the return value of a function). So save the SQL text in your variable strSQL as an actual query and then you can write another query that joins it to ConfigMaster (assuming that is a table or query). Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Thursday, May 05, 2016 2:41 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Join Issue I now get a new message of The Microsoft Access Database engine cannot find the input table or query RS1. RS1 is dimmed as a public recordset (Public RS1 As recordset). I use a set statement with RS1 after creating it. Set RS1 = MyDB.OpenRecordset(strSQL) Thanks for your assistance. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, May 05, 2016 1:30 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Join Issue In your join statements you are using Bang! Instead of dot. Try... RS1 INNER JOIN ConfigMaster ON RS1.[Other Patterns Completion is in]= ConfigMaster.PID And INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2.Well_API_14 Lambert -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Thursday, May 05, 2016 1:58 PM To: Access Developers discussion and problem solving Subject: [AccessD] Join Issue The following sql throws and error of Join Expression not Supported. I don't think I have a syntax error so am I trying to do the impossible/forbidden? When using actual table and query names it ran fine. Thank you for your assistance. Function Injectors_around_Completion_in_Activated_Pattern() Dim strSQL As String strSQL = "SELECT RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "FROM (RS1 INNER JOIN ConfigMaster ON RS1![Other Patterns Completion is in]= ConfigMaster.PID) " & _ "INNER JOIN RS2 ON ConfigMaster.ChildPID = RS2!Well_API_14 " & _ "WHERE (((RS2![RBI Cum]) > 0)) " & _ "GROUP BY RS1!PatternName, RS1![Completion in Pattern], RS1![Other Patterns Completion is in], ConfigMaster.ChildPID, ConfigMaster.WellName " & _ "ORDER BY RS1!PatternName DESC , RS1![Completion in Pattern], ConfigMaster.ChildPID;" Set RS3 = MyDB.OpenRecordset(strSQL) End Function -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu May 5 15:49:28 2016 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 06 May 2016 06:49:28 +1000 Subject: [AccessD] select top and limit... In-Reply-To: References: <01c701d1a6a2$32f27bc0$98d77340$@otenet.gr>, <572B2106.10871.43C53CB5@stuart.lexacorp.com.pg>, Message-ID: <572BB1D8.248.1691F2@stuart.lexacorp.com.pg> Relevan tto this thread? Possibly. (But I think my solutions are simpler) Useful? Very! I've just added it to my toolbox :) Thanks for that one. -- Stuart On 5 May 2016 at 7:06, jack drawbridge wrote: > There is a sample (found via Google and *not* tested by me) of MySQL > ranking query with ties at > http://fellowtuts.com/mysql/query-to-obtain-rank-function-in-mysql/ > > Hope it is useful. > > On Thu, May 5, 2016 at 6:31 AM, Stuart McLachlan > wrote: > > > Another thought: > > > > Select where CountofID_Films >= > > (Select CountofID_Fims from LIMIT 10,1) > > > > On 5 May 2016 at 20:08, Stuart McLachlan wrote: > > > > > About the only way that I can see it would be > > > a UNION to a second query which return all the records matching > > > the last. Something like: > > > > > > Select LIMIT 9 > > > UNION > > > Select . > > > where CountOfID_films IN > > >