From bensonforums at gmail.com Sat Aug 1 10:26:01 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 1 Aug 2015 11:26:01 -0400 Subject: [AccessD] No Current Record when populating additem combo??? Message-ID: I have a cbo whose rowsourcetype is value list. The problem is occurring on Form_Load, where I call a routine to populate the cbo. There is no controlsource, so this cbo is not tied to any field in the recordsource. I have stored some values that can go into the cbo (strings) in a collection. At the time I am having this problem there is only one item in the collection and the cbo is empty.. My code is failing here: For i = 1 To col.Count cboSessionUser.AddItem col(i) Next The error message is Runtime Error 3021 "No Current Record". This doesn't make any sense to me. From df.waters at outlook.com Sat Aug 1 12:29:23 2015 From: df.waters at outlook.com (Dan Waters) Date: Sat, 1 Aug 2015 12:29:23 -0500 Subject: [AccessD] No Current Record when populating additem combo??? Message-ID: Hi Bill, Column.count is zero-based. Try For i = 0 To col.Count - 1 Hope that's it! Dan Sent from my Windows Phone ________________________________ From: Bill Benson Sent: ?8/?1/?2015 10:28 To: Access Developers discussion and problem solving Subject: [AccessD] No Current Record when populating additem combo??? I have a cbo whose rowsourcetype is value list. The problem is occurring on Form_Load, where I call a routine to populate the cbo. There is no controlsource, so this cbo is not tied to any field in the recordsource. I have stored some values that can go into the cbo (strings) in a collection. At the time I am having this problem there is only one item in the collection and the cbo is empty.. My code is failing here: For i = 1 To col.Count cboSessionUser.AddItem col(i) Next The error message is Runtime Error 3021 "No Current Record". This doesn't make any sense to me. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Sat Aug 1 14:30:24 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 1 Aug 2015 15:30:24 -0400 Subject: [AccessD] No Current Record when populating additem combo??? In-Reply-To: References: Message-ID: I don't follow. Collections are not 0 based as far as I know. Besides, that would be a error code 1004 or something - this is a data error, relating to no current record. I think I have solved it, but I have to get home to check. I think I have relied on a default property and I should not have, since adding objects (in this case a field) absorbs them whole. I should have used Col.add rst.fields (0).value, rst.fields (0).value Instead of Col.add rst.fields (0), rst.fields (0) none of you would have known that because I did not post all of my code I am sorry On Aug 1, 2015 1:31 PM, "Dan Waters" wrote: > Hi Bill, > > Column.count is zero-based. > > Try For i = 0 To col.Count - 1 > > Hope that's it! > Dan > > > Sent from my Windows Phone > ________________________________ > From: Bill Benson > Sent: ?8/?1/?2015 10:28 > To: Access Developers discussion and problem solving accessd at databaseadvisors.com> > Subject: [AccessD] No Current Record when populating additem combo??? > > I have a cbo whose rowsourcetype is value list. > The problem is occurring on Form_Load, where I call a routine to populate > the cbo. > There is no controlsource, so this cbo is not tied to any field in the > recordsource. > > I have stored some values that can go into the cbo (strings) in a > collection. > > At the time I am having this problem there is only one item in the > collection and the cbo is empty.. > > My code is failing here: > > For i = 1 To col.Count > cboSessionUser.AddItem col(i) > Next > > The error message is Runtime Error 3021 "No Current Record". > > This doesn't make any sense to me. > -- > 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 Sat Aug 1 21:46:00 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 1 Aug 2015 22:46:00 -0400 Subject: [AccessD] No Current Record when populating additem combo??? In-Reply-To: References: Message-ID: OK, that was it On Sat, Aug 1, 2015 at 3:30 PM, Bill Benson wrote: > I don't follow. Collections are not 0 based as far as I know. Besides, > that would be a error code 1004 or something - this is a data error, > relating to no current record. > > I think I have solved it, but I have to get home to check. I think I have > relied on a default property and I should not have, since adding objects > (in this case a field) absorbs them whole. > > I should have used > > Col.add rst.fields (0).value, rst.fields (0).value > > Instead of > > Col.add rst.fields (0), rst.fields (0) > > none of you would have known that because I did not post all of my code > I am sorry > On Aug 1, 2015 1:31 PM, "Dan Waters" wrote: > >> Hi Bill, >> >> Column.count is zero-based. >> >> Try For i = 0 To col.Count - 1 >> >> Hope that's it! >> Dan >> >> >> Sent from my Windows Phone >> ________________________________ >> From: Bill Benson >> Sent: ?8/?1/?2015 10:28 >> To: Access Developers discussion and problem solving> accessd at databaseadvisors.com> >> Subject: [AccessD] No Current Record when populating additem combo??? >> >> I have a cbo whose rowsourcetype is value list. >> The problem is occurring on Form_Load, where I call a routine to populate >> the cbo. >> There is no controlsource, so this cbo is not tied to any field in the >> recordsource. >> >> I have stored some values that can go into the cbo (strings) in a >> collection. >> >> At the time I am having this problem there is only one item in the >> collection and the cbo is empty.. >> >> My code is failing here: >> >> For i = 1 To col.Count >> cboSessionUser.AddItem col(i) >> Next >> >> The error message is Runtime Error 3021 "No Current Record". >> >> This doesn't make any sense to me. >> -- >> 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 rockysmolin at bchacc.com Sun Aug 2 15:10:05 2015 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 2 Aug 2015 13:10:05 -0700 Subject: [AccessD] Mixed Versions Message-ID: Dear List: I created an app for a client in A2003 that exports stuff to Excel but using VBA not the Transfer Spreadsheet function. I used early binding because that seems to work - even when the target machine has Office 2007 or 2010 - the reference seems to resolve OK to the version excel on that machine. However, the client recently upgraded to O2013 but without Access. So they're using Excel 2013 with Access 2003. And of course, the export broke. I thought that the solution would be to switch to late binding. Which works on my O2003 machine fine. But still does not work on the clients mixed version machine. It blows up on the line of code (but unfortunately I cannot find the email that has the error message): objXLApp.Workbooks.Open Me.txtOutputFileName The objects are DIMmed: Dim objXLApp As Object Dim objXLBook As Object Dim objXLWS As Object and the code snip is: Call CopyFileA(Me.txtRecievingInspectionCutStockTemplate, Me.txtOutputFileName, False) Set objXLApp = CreateObject("Excel.Application") objXLApp.Workbooks.Open Me.txtOutputFileName Set objXLWS = objXLApp.ActiveSheet where txtOutputFileName has the path and file name to be opened. I'll try to get some more info but in the meantime is there some change I have to make to syntax in objXLApp.Workbooks.Open for Excel 2013? MTIA Rocky From jimdettman at verizon.net Sun Aug 2 16:18:17 2015 From: jimdettman at verizon.net (Jim Dettman) Date: Sun, 02 Aug 2015 17:18:17 -0400 Subject: [AccessD] Mixed Versions In-Reply-To: References: Message-ID: <734335899F214AB58A4196C2F23DDB44@XPS> Rocky, The late binding should work fine... Their not using Office 365 web apps are they? The other gotcha would be if their using Office 2013 64 bit edition. Your code is making 32 bit calls. If they are tell them to switch to the 32 bit edition (they'll be a lot happier in the long run). Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Sunday, August 02, 2015 04:10 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Mixed Versions Dear List: I created an app for a client in A2003 that exports stuff to Excel but using VBA not the Transfer Spreadsheet function. I used early binding because that seems to work - even when the target machine has Office 2007 or 2010 - the reference seems to resolve OK to the version excel on that machine. However, the client recently upgraded to O2013 but without Access. So they're using Excel 2013 with Access 2003. And of course, the export broke. I thought that the solution would be to switch to late binding. Which works on my O2003 machine fine. But still does not work on the clients mixed version machine. It blows up on the line of code (but unfortunately I cannot find the email that has the error message): objXLApp.Workbooks.Open Me.txtOutputFileName The objects are DIMmed: Dim objXLApp As Object Dim objXLBook As Object Dim objXLWS As Object and the code snip is: Call CopyFileA(Me.txtRecievingInspectionCutStockTemplate, Me.txtOutputFileName, False) Set objXLApp = CreateObject("Excel.Application") objXLApp.Workbooks.Open Me.txtOutputFileName Set objXLWS = objXLApp.ActiveSheet where txtOutputFileName has the path and file name to be opened. I'll try to get some more info but in the meantime is there some change I have to make to syntax in objXLApp.Workbooks.Open for Excel 2013? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sun Aug 2 16:22:30 2015 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 2 Aug 2015 14:22:30 -0700 Subject: [AccessD] Mixed Versions In-Reply-To: <734335899F214AB58A4196C2F23DDB44@XPS> References: <734335899F214AB58A4196C2F23DDB44@XPS> Message-ID: Oh yeah - the old 32/64 bit gotcha. Forgot all about that one. No it's not O365 (AFAIK, I should verify but I'd bet a dollar they're not). I'm trying right now to set up a virtual machine O2013 minus Access & Access 2003. See if I can duplicate the problem. Tks Rocky -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Sunday, August 02, 2015 2:18 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Mixed Versions Rocky, The late binding should work fine... Their not using Office 365 web apps are they? The other gotcha would be if their using Office 2013 64 bit edition. Your code is making 32 bit calls. If they are tell them to switch to the 32 bit edition (they'll be a lot happier in the long run). Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Sunday, August 02, 2015 04:10 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Mixed Versions Dear List: I created an app for a client in A2003 that exports stuff to Excel but using VBA not the Transfer Spreadsheet function. I used early binding because that seems to work - even when the target machine has Office 2007 or 2010 - the reference seems to resolve OK to the version excel on that machine. However, the client recently upgraded to O2013 but without Access. So they're using Excel 2013 with Access 2003. And of course, the export broke. I thought that the solution would be to switch to late binding. Which works on my O2003 machine fine. But still does not work on the clients mixed version machine. It blows up on the line of code (but unfortunately I cannot find the email that has the error message): objXLApp.Workbooks.Open Me.txtOutputFileName The objects are DIMmed: Dim objXLApp As Object Dim objXLBook As Object Dim objXLWS As Object and the code snip is: Call CopyFileA(Me.txtRecievingInspectionCutStockTemplate, Me.txtOutputFileName, False) Set objXLApp = CreateObject("Excel.Application") objXLApp.Workbooks.Open Me.txtOutputFileName Set objXLWS = objXLApp.ActiveSheet where txtOutputFileName has the path and file name to be opened. I'll try to get some more info but in the meantime is there some change I have to make to syntax in objXLApp.Workbooks.Open for Excel 2013? MTIA Rocky -- 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 rockysmolin at bchacc.com Sun Aug 2 16:25:01 2015 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 2 Aug 2015 14:25:01 -0700 Subject: [AccessD] Mixed Versions References: <734335899F214AB58A4196C2F23DDB44@XPS> Message-ID: <32E994BCCDAA4DCEB528590950C19FEE@HAL9007> So here's an odd problem. I'm trying to set up a virtual machine with )2013 minus Access. But unlike every other previous Office, I don't get an opportunity to select the apps I want. It just installs the whole thing. :( Am I missing something? R -----Original Message----- From: Rocky Smolin [mailto:rockysmolin at bchacc.com] Sent: Sunday, August 02, 2015 2:23 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Mixed Versions Oh yeah - the old 32/64 bit gotcha. Forgot all about that one. No it's not O365 (AFAIK, I should verify but I'd bet a dollar they're not). I'm trying right now to set up a virtual machine O2013 minus Access & Access 2003. See if I can duplicate the problem. Tks Rocky -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Sunday, August 02, 2015 2:18 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Mixed Versions Rocky, The late binding should work fine... Their not using Office 365 web apps are they? The other gotcha would be if their using Office 2013 64 bit edition. Your code is making 32 bit calls. If they are tell them to switch to the 32 bit edition (they'll be a lot happier in the long run). Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Sunday, August 02, 2015 04:10 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Mixed Versions Dear List: I created an app for a client in A2003 that exports stuff to Excel but using VBA not the Transfer Spreadsheet function. I used early binding because that seems to work - even when the target machine has Office 2007 or 2010 - the reference seems to resolve OK to the version excel on that machine. However, the client recently upgraded to O2013 but without Access. So they're using Excel 2013 with Access 2003. And of course, the export broke. I thought that the solution would be to switch to late binding. Which works on my O2003 machine fine. But still does not work on the clients mixed version machine. It blows up on the line of code (but unfortunately I cannot find the email that has the error message): objXLApp.Workbooks.Open Me.txtOutputFileName The objects are DIMmed: Dim objXLApp As Object Dim objXLBook As Object Dim objXLWS As Object and the code snip is: Call CopyFileA(Me.txtRecievingInspectionCutStockTemplate, Me.txtOutputFileName, False) Set objXLApp = CreateObject("Excel.Application") objXLApp.Workbooks.Open Me.txtOutputFileName Set objXLWS = objXLApp.ActiveSheet where txtOutputFileName has the path and file name to be opened. I'll try to get some more info but in the meantime is there some change I have to make to syntax in objXLApp.Workbooks.Open for Excel 2013? MTIA Rocky -- 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 df.waters at outlook.com Mon Aug 3 16:28:07 2015 From: df.waters at outlook.com (Dan Waters) Date: Mon, 3 Aug 2015 16:28:07 -0500 Subject: [AccessD] Mixed Versions In-Reply-To: References: Message-ID: Hi Rocky, When you use the TransferSpreadsheet function, you use something like do this: DoCmd.TranserSpreadsheet acExport, acSpreadsheetType, "tableORquery", "FullPathToSpreadsheetFile" acSpreadsheetType for Access 2000, 2002, 2003, and 2007 is acSpreadsheetTypeExcel9 (or just 9). acSpreadsheetType for Access 2010 and up is acSpreadsheetTypeExcel12 (or just 10). Check to see if you are using acSpreadsheetTypeExcel12 (or 10). Another way I create a spreadsheet from Access data is this: DoCmd.OutputTo acOutputQuery, stgSQL, acFormatXLS, stgSpreadsheetFullPath I think this is a 'generic' way of moving the data, but this has sometimes worked for me when TransferSpreadsheet didn't work. Good Luck! Dan -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Sunday, August 02, 2015 3:10 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Mixed Versions Dear List: I created an app for a client in A2003 that exports stuff to Excel but using VBA not the Transfer Spreadsheet function. I used early binding because that seems to work - even when the target machine has Office 2007 or 2010 - the reference seems to resolve OK to the version excel on that machine. However, the client recently upgraded to O2013 but without Access. So they're using Excel 2013 with Access 2003. And of course, the export broke. I thought that the solution would be to switch to late binding. Which works on my O2003 machine fine. But still does not work on the clients mixed version machine. It blows up on the line of code (but unfortunately I cannot find the email that has the error message): objXLApp.Workbooks.Open Me.txtOutputFileName The objects are DIMmed: Dim objXLApp As Object Dim objXLBook As Object Dim objXLWS As Object and the code snip is: Call CopyFileA(Me.txtRecievingInspectionCutStockTemplate, Me.txtOutputFileName, False) Set objXLApp = CreateObject("Excel.Application") objXLApp.Workbooks.Open Me.txtOutputFileName Set objXLWS = objXLApp.ActiveSheet where txtOutputFileName has the path and file name to be opened. I'll try to get some more info but in the meantime is there some change I have to make to syntax in objXLApp.Workbooks.Open for Excel 2013? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Aug 3 16:39:59 2015 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 3 Aug 2015 14:39:59 -0700 Subject: [AccessD] Mixed Versions In-Reply-To: References: Message-ID: Dan: I'm not using TransferSpreadsheet. I'm using VBA to output the data cell by cell. Here's a formatting snip: Set objXLApp = CreateObject("Excel.Application") objXLApp.Workbooks.Open Me.txtOutputFileName If Me.fraTemplate = 3 Then GoTo Alcoa: Set objXLWS = objXLApp.ActiveSheet ' do some formatting If Me.fraTemplate <> 4 Then objXLWS.PageSetup.PrintGridlines = True objXLWS.PageSetup.Orientation = xlPortrait objXLApp.Rows("1:1").Select objXLApp.Selection.HorizontalAlignment = xlCenter objXLApp.Columns("A:K").Select objXLApp.Selection.HorizontalAlignment = xlCenter objXLApp.Selection.WrapText = True objXLApp.Selection.Font.Bold = True objXLApp.Columns("A:A").ColumnWidth = 11 objXLApp.Columns("B:B").ColumnWidth = 9.71 objXLApp.Columns("C:C").ColumnWidth = 6.43 objXLApp.Columns("D:D").ColumnWidth = 15 objXLApp.Columns("E:E").ColumnWidth = 10.29 objXLApp.Columns("F:F").ColumnWidth = 10.43 objXLApp.Columns("G:G").ColumnWidth = 11 objXLApp.Columns("H:H").ColumnWidth = 9.71 objXLApp.Columns("H:H").ColumnWidth = 10.71 objXLApp.Columns("I:I").ColumnWidth = 6.43 objXLApp.Columns("J:J").ColumnWidth = 8.14 objXLApp.Columns("K:K").ColumnWidth = 9.57 End If Here's a data transfer snip: Do While Not rs.EOF objXLWS.Cells(intRow, 1) = rs!fldContainerRecordingDate objXLWS.Cells(intRow, 2) = rs!fldContainerCheck4 objXLWS.Cells(intRow, 3) = rs!fldContainerCheck5 objXLWS.Cells(intRow, 4) = rs!fldLotNumber objXLWS.Cells(intRow, 5) = rs!fldContainerRackLetter objXLWS.Cells(intRow, 6) = rs!fldJobsJobNumber objXLWS.Cells(intRow, 8) = _ (rs!fldContainerGross - rs!fldContainerTare) / objXLWS.Cells(2, 8) objXLWS.Cells(intRow, 9) = rs!fldContainerTotalPieces objXLWS.Cells(intRow, 10) = rs!fldContainerGross - rs!fldContainerTare objXLWS.Cells(intRow, 11) = rs!fldContainerTare objXLWS.Cells(intRow, 12) = rs!fldContainerGross objXLWS.Cells(intRow, 15) = rs!fldTruckPlanShipDate intRow = intRow + 1 rs.MoveNext I like this method - you have real precise control over the spreadsheet. Unfortunately the line of code with the problem ocurrs before any of these machinations. R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Monday, August 03, 2015 2:28 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Mixed Versions Hi Rocky, When you use the TransferSpreadsheet function, you use something like do this: DoCmd.TranserSpreadsheet acExport, acSpreadsheetType, "tableORquery", "FullPathToSpreadsheetFile" acSpreadsheetType for Access 2000, 2002, 2003, and 2007 is acSpreadsheetTypeExcel9 (or just 9). acSpreadsheetType for Access 2010 and up is acSpreadsheetTypeExcel12 (or just 10). Check to see if you are using acSpreadsheetTypeExcel12 (or 10). Another way I create a spreadsheet from Access data is this: DoCmd.OutputTo acOutputQuery, stgSQL, acFormatXLS, stgSpreadsheetFullPath I think this is a 'generic' way of moving the data, but this has sometimes worked for me when TransferSpreadsheet didn't work. Good Luck! Dan -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Sunday, August 02, 2015 3:10 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Mixed Versions Dear List: I created an app for a client in A2003 that exports stuff to Excel but using VBA not the Transfer Spreadsheet function. I used early binding because that seems to work - even when the target machine has Office 2007 or 2010 - the reference seems to resolve OK to the version excel on that machine. However, the client recently upgraded to O2013 but without Access. So they're using Excel 2013 with Access 2003. And of course, the export broke. I thought that the solution would be to switch to late binding. Which works on my O2003 machine fine. But still does not work on the clients mixed version machine. It blows up on the line of code (but unfortunately I cannot find the email that has the error message): objXLApp.Workbooks.Open Me.txtOutputFileName The objects are DIMmed: Dim objXLApp As Object Dim objXLBook As Object Dim objXLWS As Object and the code snip is: Call CopyFileA(Me.txtRecievingInspectionCutStockTemplate, Me.txtOutputFileName, False) Set objXLApp = CreateObject("Excel.Application") objXLApp.Workbooks.Open Me.txtOutputFileName Set objXLWS = objXLApp.ActiveSheet where txtOutputFileName has the path and file name to be opened. I'll try to get some more info but in the meantime is there some change I have to make to syntax in objXLApp.Workbooks.Open for Excel 2013? MTIA Rocky -- 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 rockysmolin at bchacc.com Thu Aug 6 13:48:16 2015 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 6 Aug 2015 11:48:16 -0700 Subject: [AccessD] Input Mask for Date Format Message-ID: <07ECDE0990F44C27971DD3CD1EBD9682@HAL9007> Dear List: Having a problem generating an input mask for a text box that is bound to a date/time field (I always have problems with the input mask). The user wants MM/DD/YYYY hh:mm Any suggestions greatly appreciated. MTIA, Rocky Smolin Beach Access Software 858-259-4334 www.bchacc.com www.e-z-mrp.com Skype: rocky.smolin From steve at datamanagementsolutions.biz Thu Aug 6 16:27:51 2015 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Fri, 7 Aug 2015 09:27:51 +1200 Subject: [AccessD] Input Mask for Date Format In-Reply-To: <07ECDE0990F44C27971DD3CD1EBD9682@HAL9007> References: <07ECDE0990F44C27971DD3CD1EBD9682@HAL9007> Message-ID: <5E42D3BD077742298415F3094F315CF1@SteveT540p> Hi Rocky I have two suggestions, which are a bit contrary to the user's current viewpoint. 1. Put the date and time in 2 separate fields. 2. Forget the idea of an input mask for dates. It makes data entry more difficult with no benefit. Access allows you to enter the date in any way you want, and then display it as per the format you specify for the control. As you know, Access stores the date as a long integer, which is exactly the same regardless of the format of data entry. A few minutes of staff training is way better than trying to pointlessly shackle them. Just my 2c. Regards Steve -----Original Message----- From: Rocky Smolin Sent: Friday, August 7, 2015 6:48 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Input Mask for Date Format Dear List: Having a problem generating an input mask for a text box that is bound to a date/time field (I always have problems with the input mask). The user wants MM/DD/YYYY hh:mm Any suggestions greatly appreciated. MTIA, Rocky Smolin Beach Access Software 858-259-4334 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 jamesbutton at blueyonder.co.uk Thu Aug 6 16:58:45 2015 From: jamesbutton at blueyonder.co.uk (James Button) Date: Thu, 6 Aug 2015 22:58:45 +0100 Subject: [AccessD] Input Mask for Date Format In-Reply-To: <5E42D3BD077742298415F3094F315CF1@SteveT540p> References: <07ECDE0990F44C27971DD3CD1EBD9682@HAL9007> <5E42D3BD077742298415F3094F315CF1@SteveT540p> Message-ID: I believe that there will be several discussion threads in the archives about using datepickers. Definitely split the data into date and time fields Also for verifying the date as entered has been correctly evaluated re-show any entry as dd mmm yyyy So that it is clear what part of the input was used for day of month, and for the year. JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Schapel Sent: Thursday, August 06, 2015 10:28 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Input Mask for Date Format Hi Rocky I have two suggestions, which are a bit contrary to the user's current viewpoint. 1. Put the date and time in 2 separate fields. 2. Forget the idea of an input mask for dates. It makes data entry more difficult with no benefit. Access allows you to enter the date in any way you want, and then display it as per the format you specify for the control. As you know, Access stores the date as a long integer, which is exactly the same regardless of the format of data entry. A few minutes of staff training is way better than trying to pointlessly shackle them. Just my 2c. Regards Steve -----Original Message----- From: Rocky Smolin Sent: Friday, August 7, 2015 6:48 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Input Mask for Date Format Dear List: Having a problem generating an input mask for a text box that is bound to a date/time field (I always have problems with the input mask). The user wants MM/DD/YYYY hh:mm Any suggestions greatly appreciated. MTIA, Rocky Smolin Beach Access Software 858-259-4334 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 stuart at lexacorp.com.pg Thu Aug 6 17:34:28 2015 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 07 Aug 2015 08:34:28 +1000 Subject: [AccessD] Input Mask for Date Format In-Reply-To: <07ECDE0990F44C27971DD3CD1EBD9682@HAL9007> References: <07ECDE0990F44C27971DD3CD1EBD9682@HAL9007> Message-ID: <55C3E0F4.27641.9827659@stuart.lexacorp.com.pg> I'm with Steve and Jim. Is this the actual "user" who has to enter these dates or someone else (supervisor/the person who has purchased the system, ...) ? Talk to the person and see if you can change his mind. :) Let the user enter it any way they want and display it so that it is un-ambiguous once entered. On 6 Aug 2015 at 11:48, Rocky Smolin wrote: > Dear List: > > Having a problem generating an input mask for a text box that is bound > to a date/time field (I always have problems with the input mask). > > The user wants MM/DD/YYYY hh:mm > > Any suggestions greatly appreciated. > > MTIA, > > Rocky Smolin > Beach Access Software > 858-259-4334 > 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 rockysmolin at bchacc.com Thu Aug 6 18:07:24 2015 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 6 Aug 2015 16:07:24 -0700 Subject: [AccessD] Input Mask for Date Format In-Reply-To: <5E42D3BD077742298415F3094F315CF1@SteveT540p> References: <07ECDE0990F44C27971DD3CD1EBD9682@HAL9007> <5E42D3BD077742298415F3094F315CF1@SteveT540p> Message-ID: <745E1C5D72A44A23A9FB127CA18B9A84@HAL9007> Steve: I agree. In fact suggestion one they did on Tab 1 of the 7 tab form. On tab 2 however, they want them combined! User (sigh) you never know what they're going to do next... Suggestion 2 - That's too easy. I'll pass that by them and see if I can make that fly. R -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Schapel Sent: Thursday, August 06, 2015 2:28 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Input Mask for Date Format Hi Rocky I have two suggestions, which are a bit contrary to the user's current viewpoint. 1. Put the date and time in 2 separate fields. 2. Forget the idea of an input mask for dates. It makes data entry more difficult with no benefit. Access allows you to enter the date in any way you want, and then display it as per the format you specify for the control. As you know, Access stores the date as a long integer, which is exactly the same regardless of the format of data entry. A few minutes of staff training is way better than trying to pointlessly shackle them. Just my 2c. Regards Steve -----Original Message----- From: Rocky Smolin Sent: Friday, August 7, 2015 6:48 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Input Mask for Date Format Dear List: Having a problem generating an input mask for a text box that is bound to a date/time field (I always have problems with the input mask). The user wants MM/DD/YYYY hh:mm Any suggestions greatly appreciated. MTIA, Rocky Smolin Beach Access Software 858-259-4334 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 ssharkins at gmail.com Fri Aug 7 09:41:24 2015 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 7 Aug 2015 10:41:24 -0400 Subject: [AccessD] Weird error upon open Message-ID: The following function is throwing an error when the database throws any error upon opening: VBE.ActiveCodePane.CodeModule The rest of the time, it works fine. This only breaks when the first thing I try to do produces an error. Any idea why? Susan Harkins From jimdettman at verizon.net Fri Aug 7 09:51:38 2015 From: jimdettman at verizon.net (Jim Dettman) Date: Fri, 07 Aug 2015 10:51:38 -0400 Subject: [AccessD] Weird error upon open In-Reply-To: References: Message-ID: <37A508E76AEE4FBD9BF79D7D8344EC82@XPS> Without more context it's hard to say, but my guess would be that the VBE is not open as yet. I've never used that method to get the module name, I always use a constant. Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, August 07, 2015 10:41 AM To: Access Developers discussion and problem solving Subject: [AccessD] Weird error upon open The following function is throwing an error when the database throws any error upon opening: VBE.ActiveCodePane.CodeModule The rest of the time, it works fine. This only breaks when the first thing I try to do produces an error. Any idea why? Susan Harkins -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From ssharkins at gmail.com Fri Aug 7 09:55:37 2015 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 7 Aug 2015 10:55:37 -0400 Subject: [AccessD] Weird error upon open In-Reply-To: <37A508E76AEE4FBD9BF79D7D8344EC82@XPS> References: <37A508E76AEE4FBD9BF79D7D8344EC82@XPS> Message-ID: Well, if the code is throwing an error, shouldn't the module be open? This function is in the middle of a SQL string that's used to log errors -- it's only called when there's an error to log. Susan H. On Fri, Aug 7, 2015 at 10:51 AM, Jim Dettman wrote: > > Without more context it's hard to say, but my guess would be that the VBE > is not open as yet. > > I've never used that method to get the module name, I always use a > constant. > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Susan Harkins > Sent: Friday, August 07, 2015 10:41 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Weird error upon open > > The following function is throwing an error when the database throws any > error upon opening: > > VBE.ActiveCodePane.CodeModule > > The rest of the time, it works fine. This only breaks when the first thing > I try to do produces an error. Any idea why? > > Susan Harkins > -- > 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 ssharkins at gmail.com Fri Aug 7 09:57:35 2015 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 7 Aug 2015 10:57:35 -0400 Subject: [AccessD] Weird error upon open In-Reply-To: <37A508E76AEE4FBD9BF79D7D8344EC82@XPS> References: <37A508E76AEE4FBD9BF79D7D8344EC82@XPS> Message-ID: Thanks Jim -- quick review of the function and it doesn't work exactly as I thought. I'm going with your idea -- a constant. Susan H. On Fri, Aug 7, 2015 at 10:51 AM, Jim Dettman wrote: > > Without more context it's hard to say, but my guess would be that the VBE > is not open as yet. > > I've never used that method to get the module name, I always use a > constant. > > Jim. > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Susan Harkins > Sent: Friday, August 07, 2015 10:41 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Weird error upon open > > The following function is throwing an error when the database throws any > error upon opening: > > VBE.ActiveCodePane.CodeModule > > The rest of the time, it works fine. This only breaks when the first thing > I try to do produces an error. Any idea why? > > Susan Harkins > -- > 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 Fri Aug 7 15:47:53 2015 From: bradm at blackforestltd.com (Brad Marks) Date: Fri, 7 Aug 2015 20:47:53 +0000 Subject: [AccessD] Percentages of Sub Totals In-Reply-To: References: , , <8E2F7AAA5FDC418FA10D376F98BF4FD7@kost36PC><55B544DD.32014.1ED2564@stuart.lexacorp.com.pg> <000301d0c7e6$2db33870$8919a950$@dalyn.co.nz>, <70899AD7769444AB8BBE8EB3C9252B20@kost36PC>, Message-ID: All, I have an Access 2007 Report that shows the number of orders that have "Drop Ships" and the number of orders that do not have Drop Ships. This report has Report Groups on Quarter, and "Drop Ship Indicator" which gives us counts of Drop Ships versus Non Drop Ships for each quarter. This works nicely. Now there is a need to show a percentage of Drop Ships versus Non Drop Ships for each quarter. I understand how to get a percentage of a final total, but I am not sure if there is a way to obtain a percentage based on another sub-total. _ _ _ _ _ _ Current report snippet ... Drop Shipped 100 Non Drop Shipped 900 Quarter 3 of 2013 1000 _ _ _ _ _ _ Desired result ... Drop Shipped 100 10% Non Drop Shipped 900 90% Quarter 3 of 2013 1000 _ _ _ _ _ _ Thanks, Brad From bradm at blackforestltd.com Fri Aug 7 16:12:33 2015 From: bradm at blackforestltd.com (Brad Marks) Date: Fri, 7 Aug 2015 21:12:33 +0000 Subject: [AccessD] Percentages of Sub Totals In-Reply-To: References: , , <8E2F7AAA5FDC418FA10D376F98BF4FD7@kost36PC><55B544DD.32014.1ED2564@stuart.lexacorp.com.pg> <000301d0c7e6$2db33870$8919a950$@dalyn.co.nz>, <70899AD7769444AB8BBE8EB3C9252B20@kost36PC>, Message-ID: Never mind. I finally found an example on the internet and I now have this working. Brad -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, August 07, 2015 3:48 PM To: Access Developers discussion and problem solving Subject: [AccessD] Percentages of Sub Totals All, I have an Access 2007 Report that shows the number of orders that have "Drop Ships" and the number of orders that do not have Drop Ships. This report has Report Groups on Quarter, and "Drop Ship Indicator" which gives us counts of Drop Ships versus Non Drop Ships for each quarter. This works nicely. Now there is a need to show a percentage of Drop Ships versus Non Drop Ships for each quarter. I understand how to get a percentage of a final total, but I am not sure if there is a way to obtain a percentage based on another sub-total. _ _ _ _ _ _ Current report snippet ... Drop Shipped 100 Non Drop Shipped 900 Quarter 3 of 2013 1000 _ _ _ _ _ _ Desired result ... Drop Shipped 100 10% Non Drop Shipped 900 90% Quarter 3 of 2013 1000 _ _ _ _ _ _ Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at gmail.com Fri Aug 7 21:20:05 2015 From: jwcolby at gmail.com (John W. Colby) Date: Fri, 7 Aug 2015 22:20:05 -0400 Subject: [AccessD] A real puzzler Message-ID: <55C56755.9080704@gmail.com> My SQL Server spontaneously reboots. In the past it was once a month, then once week or two. Now it is several times a day. UNLESS SQL Server is exercised heavily, and then it will not reboot. That is counter intuitive. If the issue were a memory issue, SQL Server using all of the memory (and it does) would find and trigger such errors. If it were a heat issue, SQL Server using all of the processors (and it does) would cause more heat. Etc. If I stop the service(s) it still reboots. I am at a loss, not only as to cause, but how to troubleshoot. Any words of wisdom? Dual chip mother board. Two AMD processors each with 8 cores (15 cores total) 80 gigs RAM Windows 2008 SQL Server 2008 -- John W. Colby From bensonforums at gmail.com Fri Aug 7 21:36:28 2015 From: bensonforums at gmail.com (Bill Benson) Date: Fri, 7 Aug 2015 22:36:28 -0400 Subject: [AccessD] A real puzzler In-Reply-To: <55C56755.9080704@gmail.com> References: <55C56755.9080704@gmail.com> Message-ID: Tried uninstalling, wiping registry, reinstalling? Could you still keep your data if you did that? I have no experience from a dba perspective but this might be a way of determining whether it is something in your registry versus potentially a hardware or Bios problem. There appear to be some suggestions and analytics here for similar symptoms. https://social.technet.microsoft.com/Forums/windowsserver/en-US/1d13ac99-88cf-4ed1-97d8-7d33d463f111/server-2008-r2-random-reboots-eventid-41 On Aug 7, 2015 10:21 PM, "John W. Colby" wrote: > My SQL Server spontaneously reboots. In the past it was once a month, > then once week or two. Now it is several times a day. > > UNLESS SQL Server is exercised heavily, and then it will not reboot. > > That is counter intuitive. > > If the issue were a memory issue, SQL Server using all of the memory (and > it does) would find and trigger such errors. > If it were a heat issue, SQL Server using all of the processors (and it > does) would cause more heat. > > Etc. > > If I stop the service(s) it still reboots. > > I am at a loss, not only as to cause, but how to troubleshoot. > > Any words of wisdom? > > Dual chip mother board. > Two AMD processors each with 8 cores (15 cores total) > 80 gigs RAM > Windows 2008 > SQL Server 2008 > > -- > John W. Colby > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at gmail.com Fri Aug 7 22:32:54 2015 From: jwcolby at gmail.com (John W. Colby) Date: Fri, 7 Aug 2015 23:32:54 -0400 Subject: [AccessD] PK cast fails Message-ID: <55C57866.4000002@gmail.com> For the first time I ended up with a runtime error trying to insert data into a table. I had an autoincrement PK which was an int type and I stored so many records that the int couldn't hold the value. And so we go to a bigint. It will be interesting to see how this works. There is this thing called a "simmons protocol", which is some kind of demographic analysis used in the industry. My client needs counts from our 225 million record database of how many records are XYZ demographic. I did this "table driven" with a set of stored procedures which calculate about 220 counts from the table. Properly indexed the entire thing takes many hours, and a full day if tied to emails. the table that I built to drive the counts looks like the following, which are just a few of the 220+ counts I have to do. PK SimmonsDefinition Code DB101Field DB101FieldName HowUsed1 SQL1 HowUsed2 SQL2 1 32 MARRIED M 32 Marital_Status NULL NULL NULL NULL 2 32 SINGLE S 32 Marital_Status NULL NULL NULL NULL 3 33 MOVED INTO PRESENT RESIDENCE IN LAST 12 MOS NULL 33 Length_Of_Residence C = '0' NULL NULL 4 39 AGE 18-19 NULL 39 Date_Of_Birth_Year F (DATEPART(yy, GETDATE()) - Date_Of_Birth_Year >= 18 AND DATEPART(yy, GETDATE()) - Date_Of_Birth_Year <= 19) NULL NULL 5 39 AGE 20-21 NULL 39 Date_Of_Birth_Year F (DATEPART(yy, GETDATE()) - Date_Of_Birth_Year >= 20 AND DATEPART(yy, GETDATE()) - Date_Of_Birth_Year <= 21) NULL NULL 6 39 AGE 22 - 24 NULL 39 Date_Of_Birth_Year F (DATEPART(yy, GETDATE()) - Date_Of_Birth_Year >= 22 AND DATEPART(yy, GETDATE()) - Date_Of_Birth_Year <= 24) NULL NULL 18 43 SENIOR ADULTS IN HH (55+) Y 43 Senior_Adult_In_Household NULL NULL NULL NULL 19 44 EMPTY NESTER Y 44 Empty_Nester NULL NULL NULL NULL 20 45 SINGLE PARENT 1 45 Single_Parent NULL NULL NULL NULL I woke up this morning and realized that I needed to select each PKID from DB101 which matched each Simmons selection, and store those with the Simmons PKID. Do this one time and then do my counts off of the stored results instead of recounting each time. The issue I am having is that a) the SQL for doing the selection (or count) is dynamically created, but even worse, the WHERE field is pulled from usually one of hundreds of possible fields in DB101. And it is literally impossible to do indexes on that many fields, and especially across 225 million rows. So I am building a table that looks like: PK (bigint) PKSimmons (int) PKDB101 (int) Select ALL of the DB101 PKs that match each simmons criteria one time and store in a table as above. Select once and store, index the two fields, and then use a join on this table to do further processing, including counts in the future. It appears as I will have many billions of records in this table. I do know that after about 75 selections, I hit the limit of the Int data type to hold my PK (~ 2 billion records), which I had therefore had to change to a BigInt. It will be interesting to see how long it takes to build an index on the PKSimmons and PKDB101 fields for future selects. And of course, how fast PKDB101 values can be pulled out when selected by the PKSimmons field given an index on those two fields - across an index over 8 or 10 billion records. I will report back some results once the table insert(s) finish. -- John W. Colby From jamesbutton at blueyonder.co.uk Sat Aug 8 03:53:18 2015 From: jamesbutton at blueyonder.co.uk (James Button) Date: Sat, 8 Aug 2015 09:53:18 +0100 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> Message-ID: Power supply problems - as in maybe external causes - a nearby fridge-freezer motor/compressor Could also be failing memory - triggered by power management of some device First - check the power management - anything set to go to idle? My first physical 'test' would be a second PC on the same supply socket - both failing points to the external source Then - add in a voltage recorder - looking for momentary drops may effect one output of a PSU that is not in the best of condition Then - maybe replace the PSU After that - it's going to be memory - maybe pulling individual modules JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Saturday, August 08, 2015 3:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A real puzzler Tried uninstalling, wiping registry, reinstalling? Could you still keep your data if you did that? I have no experience from a dba perspective but this might be a way of determining whether it is something in your registry versus potentially a hardware or Bios problem. There appear to be some suggestions and analytics here for similar symptoms. https://social.technet.microsoft.com/Forums/windowsserver/en-US/1d13ac99-88cf-4e d1-97d8-7d33d463f111/server-2008-r2-random-reboots-eventid-41 On Aug 7, 2015 10:21 PM, "John W. Colby" wrote: > My SQL Server spontaneously reboots. In the past it was once a month, > then once week or two. Now it is several times a day. > > UNLESS SQL Server is exercised heavily, and then it will not reboot. > > That is counter intuitive. > > If the issue were a memory issue, SQL Server using all of the memory (and > it does) would find and trigger such errors. > If it were a heat issue, SQL Server using all of the processors (and it > does) would cause more heat. > > Etc. > > If I stop the service(s) it still reboots. > > I am at a loss, not only as to cause, but how to troubleshoot. > > Any words of wisdom? > > Dual chip mother board. > Two AMD processors each with 8 cores (15 cores total) > 80 gigs RAM > Windows 2008 > SQL Server 2008 > > -- > John W. Colby > > -- > 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 Sat Aug 8 05:29:09 2015 From: jimdettman at verizon.net (Jim Dettman) Date: Sat, 08 Aug 2015 06:29:09 -0400 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> Message-ID: <1022E1B177C94A4BAC50605960BE881C@XPS> Could thoughts all. I would also add a check of the event logs in windows and run a memory diagnostic. JimD. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of James Button Sent: Saturday, August 08, 2015 04:53 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A real puzzler Power supply problems - as in maybe external causes - a nearby fridge-freezer motor/compressor Could also be failing memory - triggered by power management of some device First - check the power management - anything set to go to idle? My first physical 'test' would be a second PC on the same supply socket - both failing points to the external source Then - add in a voltage recorder - looking for momentary drops may effect one output of a PSU that is not in the best of condition Then - maybe replace the PSU After that - it's going to be memory - maybe pulling individual modules JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Saturday, August 08, 2015 3:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A real puzzler Tried uninstalling, wiping registry, reinstalling? Could you still keep your data if you did that? I have no experience from a dba perspective but this might be a way of determining whether it is something in your registry versus potentially a hardware or Bios problem. There appear to be some suggestions and analytics here for similar symptoms. https://social.technet.microsoft.com/Forums/windowsserver/en-US/1d13ac99-88c f-4e d1-97d8-7d33d463f111/server-2008-r2-random-reboots-eventid-41 On Aug 7, 2015 10:21 PM, "John W. Colby" wrote: > My SQL Server spontaneously reboots. In the past it was once a month, > then once week or two. Now it is several times a day. > > UNLESS SQL Server is exercised heavily, and then it will not reboot. > > That is counter intuitive. > > If the issue were a memory issue, SQL Server using all of the memory (and > it does) would find and trigger such errors. > If it were a heat issue, SQL Server using all of the processors (and it > does) would cause more heat. > > Etc. > > If I stop the service(s) it still reboots. > > I am at a loss, not only as to cause, but how to troubleshoot. > > Any words of wisdom? > > Dual chip mother board. > Two AMD processors each with 8 cores (15 cores total) > 80 gigs RAM > Windows 2008 > SQL Server 2008 > > -- > John W. Colby > > -- > 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 jimdettman at verizon.net Sat Aug 8 06:01:00 2015 From: jimdettman at verizon.net (Jim Dettman) Date: Sat, 08 Aug 2015 07:01:00 -0400 Subject: [AccessD] A real puzzler In-Reply-To: <1022E1B177C94A4BAC50605960BE881C@XPS> References: <55C56755.9080704@gmail.com> <1022E1B177C94A4BAC50605960BE881C@XPS> Message-ID: That was supposed to be "Good thoughts..." Stupid phone... Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Saturday, August 08, 2015 06:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A real puzzler Could thoughts all. I would also add a check of the event logs in windows and run a memory diagnostic. JimD. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of James Button Sent: Saturday, August 08, 2015 04:53 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A real puzzler Power supply problems - as in maybe external causes - a nearby fridge-freezer motor/compressor Could also be failing memory - triggered by power management of some device First - check the power management - anything set to go to idle? My first physical 'test' would be a second PC on the same supply socket - both failing points to the external source Then - add in a voltage recorder - looking for momentary drops may effect one output of a PSU that is not in the best of condition Then - maybe replace the PSU After that - it's going to be memory - maybe pulling individual modules JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Saturday, August 08, 2015 3:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A real puzzler Tried uninstalling, wiping registry, reinstalling? Could you still keep your data if you did that? I have no experience from a dba perspective but this might be a way of determining whether it is something in your registry versus potentially a hardware or Bios problem. There appear to be some suggestions and analytics here for similar symptoms. https://social.technet.microsoft.com/Forums/windowsserver/en-US/1d13ac99-88c f-4e d1-97d8-7d33d463f111/server-2008-r2-random-reboots-eventid-41 On Aug 7, 2015 10:21 PM, "John W. Colby" wrote: > My SQL Server spontaneously reboots. In the past it was once a month, > then once week or two. Now it is several times a day. > > UNLESS SQL Server is exercised heavily, and then it will not reboot. > > That is counter intuitive. > > If the issue were a memory issue, SQL Server using all of the memory (and > it does) would find and trigger such errors. > If it were a heat issue, SQL Server using all of the processors (and it > does) would cause more heat. > > Etc. > > If I stop the service(s) it still reboots. > > I am at a loss, not only as to cause, but how to troubleshoot. > > Any words of wisdom? > > Dual chip mother board. > Two AMD processors each with 8 cores (15 cores total) > 80 gigs RAM > Windows 2008 > SQL Server 2008 > > -- > John W. Colby > > -- > 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 jamesbutton at blueyonder.co.uk Sat Aug 8 06:57:02 2015 From: jamesbutton at blueyonder.co.uk (James Button) Date: Sat, 8 Aug 2015 12:57:02 +0100 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> <1022E1B177C94A4BAC50605960BE881C@XPS> Message-ID: Guest that! Re memory diagnostic - I have found with past experiences of accelerating frequency of shut-downs, that the system didn't get a chance to record any events. And memory checks showed no problems - providing the rest of the system wasn't being stressed. One system I found that removing a memory module - any of them stopped the shutdowns, and I eventually 'bodged' the system by increasing the memory refresh by a cycle. It was an old system and a 'new' memory module was, being old tech, horrendously expensive That worked for several years, and eventually management agreed the system was too slow - as in users kept complaining about the system's response, so we were actually allowed to BUY a new one! JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Saturday, August 08, 2015 12:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A real puzzler That was supposed to be "Good thoughts..." Stupid phone... Jim. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Saturday, August 08, 2015 06:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A real puzzler Could thoughts all. I would also add a check of the event logs in windows and run a memory diagnostic. JimD. -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of James Button Sent: Saturday, August 08, 2015 04:53 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A real puzzler Power supply problems - as in maybe external causes - a nearby fridge-freezer motor/compressor Could also be failing memory - triggered by power management of some device First - check the power management - anything set to go to idle? My first physical 'test' would be a second PC on the same supply socket - both failing points to the external source Then - add in a voltage recorder - looking for momentary drops may effect one output of a PSU that is not in the best of condition Then - maybe replace the PSU After that - it's going to be memory - maybe pulling individual modules JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Saturday, August 08, 2015 3:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A real puzzler Tried uninstalling, wiping registry, reinstalling? Could you still keep your data if you did that? I have no experience from a dba perspective but this might be a way of determining whether it is something in your registry versus potentially a hardware or Bios problem. There appear to be some suggestions and analytics here for similar symptoms. https://social.technet.microsoft.com/Forums/windowsserver/en-US/1d13ac99-88c f-4e d1-97d8-7d33d463f111/server-2008-r2-random-reboots-eventid-41 On Aug 7, 2015 10:21 PM, "John W. Colby" wrote: > My SQL Server spontaneously reboots. In the past it was once a month, > then once week or two. Now it is several times a day. > > UNLESS SQL Server is exercised heavily, and then it will not reboot. > > That is counter intuitive. > > If the issue were a memory issue, SQL Server using all of the memory (and > it does) would find and trigger such errors. > If it were a heat issue, SQL Server using all of the processors (and it > does) would cause more heat. > > Etc. > > If I stop the service(s) it still reboots. > > I am at a loss, not only as to cause, but how to troubleshoot. > > Any words of wisdom? > > Dual chip mother board. > Two AMD processors each with 8 cores (15 cores total) > 80 gigs RAM > Windows 2008 > SQL Server 2008 > > -- > John W. Colby > > -- > 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 jwcolby at gmail.com Sat Aug 8 07:02:27 2015 From: jwcolby at gmail.com (John W. Colby) Date: Sat, 8 Aug 2015 08:02:27 -0400 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> Message-ID: <55C5EFD3.7030503@gmail.com> The server has had this problem for years including when it was sitting in my office. It is now in a professional "hosting" company in Albany NY, which SUPPOSEDLY has handled all of those power issues for me. It has been progressively worse over the years. The memory has ECC and the motherboard can use it. The power supply was my thought and I have replaced with a huge(er) one. Still could be it of course. The fact that the system reboots under NO LOAD is the puzzler there. I would expect a PS problem to surface under max load. PLUS, in the most recent upgrade, I have DROPPED the number of disks in the system by moving from (16) 1 TB drives to (8) 3 tb drives. While the new drives use slightly more power individually, as a whole it is significantly less. In the course of upgrades I have replaced all disk drives and SSDs. THAT was not a fun task as you can imagine. I had to insert a second RAID controller, add big drives, build out the volumes, and then detach and move the SQL Server data files (and other stuff as well). Then detach the old drives and put on the shelf for awhile, while I tested the whole system. All of which did not affect the problem. I have replaced the power supply with a bigger unit. I have replaced the motherboard. Decided at the least I would have a spare. Have run memory tests. I moved the system into the server room in Albany NY (I live in NC) a couple of years ago when I was working in Raleigh Durham and so, sadly, I cannot just go into the server room and physically work on the system. The up side is that it is in a managed environment with AC / Power / Internet all conditioned. Perhaps I am fixated on and thus can't see past... the system will stay up indefinitely as long as I am flogging the system. When the system is idle it will reboot several times a day. I am pretty well convinced that there is some kind of software issue, and that I should do a windows / SQL Server reinstall. I am terrified of doing that however because of the whole windows / SQL Server "user / security" issue, which I do not fully understand. I could end up with databases that I can no longer access. Not to mention that the server is a thousand miles away in a server room, which makes physically visiting it problematic, and a reinstall definitely requires physical access. And I can't afford to just throw in a second system (it is rather powerful and expensive) to do a clean install on and migrate over to. That is in fact the ultimate solution but ... OMG the cost. John W. Colby On 8/8/2015 4:53 AM, James Button wrote: > Power supply problems - as in maybe external causes - a nearby fridge-freezer > motor/compressor > > Could also be failing memory - triggered by power management of some device > > First - check the power management - anything set to go to idle? > My first physical 'test' would be a second PC on the same supply socket - both > failing points to the external source > Then - add in a voltage recorder - looking for momentary drops may effect one > output of a PSU that is not in the best of condition > Then - maybe replace the PSU > After that - it's going to be memory - maybe pulling individual modules > > JimB > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill > Benson > Sent: Saturday, August 08, 2015 3:36 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] A real puzzler > > Tried uninstalling, wiping registry, reinstalling? Could you still keep > your data if you did that? I have no experience from a dba perspective but > this might be a way of determining whether it is something in your registry > versus potentially a hardware or Bios problem. > > There appear to be some suggestions and analytics here for similar symptoms. > > https://social.technet.microsoft.com/Forums/windowsserver/en-US/1d13ac99-88cf-4e > d1-97d8-7d33d463f111/server-2008-r2-random-reboots-eventid-41 > On Aug 7, 2015 10:21 PM, "John W. Colby" wrote: > >> My SQL Server spontaneously reboots. In the past it was once a month, >> then once week or two. Now it is several times a day. >> >> UNLESS SQL Server is exercised heavily, and then it will not reboot. >> >> That is counter intuitive. >> >> If the issue were a memory issue, SQL Server using all of the memory (and >> it does) would find and trigger such errors. >> If it were a heat issue, SQL Server using all of the processors (and it >> does) would cause more heat. >> >> Etc. >> >> If I stop the service(s) it still reboots. >> >> I am at a loss, not only as to cause, but how to troubleshoot. >> >> Any words of wisdom? >> >> Dual chip mother board. >> Two AMD processors each with 8 cores (15 cores total) >> 80 gigs RAM >> Windows 2008 >> SQL Server 2008 >> >> -- >> John W. Colby >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From jwcolby at gmail.com Sat Aug 8 07:14:47 2015 From: jwcolby at gmail.com (John W. Colby) Date: Sat, 8 Aug 2015 08:14:47 -0400 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> <1022E1B177C94A4BAC50605960BE881C@XPS> Message-ID: <55C5F2B7.3090806@gmail.com> For the last several days I have been flogging away at the system (performing real work), causing the system to stay active. All cores running, 75 (out of 80) GB used for SQL Server. No reboots during that entire time. And yet: Critical 8/4/2015 6:56:10 AM Kernel-Power 41 (63) Critical 8/4/2015 4:42:07 AM Kernel-Power 41 (63) Critical 8/3/2015 10:04:36 PM Kernel-Power 41 (63) Critical 8/3/2015 5:32:06 PM Kernel-Power 41 (63) Critical 8/3/2015 2:22:15 PM Kernel-Power 41 (63) Critical 8/2/2015 3:29:33 PM Kernel-Power 41 (63) Critical 8/2/2015 11:21:46 AM Kernel-Power 41 (63) Critical 8/2/2015 10:51:30 AM Kernel-Power 41 (63) Critical 8/2/2015 7:17:21 AM Kernel-Power 41 (63) Critical 7/31/2015 11:50:45 PM Kernel-Power 41 (63) Critical 7/31/2015 1:05:39 PM Kernel-Power 41 (63) Critical 7/30/2015 10:11:57 PM Kernel-Power 41 (63) Critical 7/30/2015 4:59:26 PM Kernel-Power 41 (63) Critical 7/29/2015 2:32:50 PM Kernel-Power 41 (63) Critical 7/28/2015 5:20:38 PM Kernel-Power 41 (63) Critical 7/28/2015 12:12:57 PM Kernel-Power 41 (63) Critical 7/28/2015 4:15:38 AM Kernel-Power 41 (63) Critical 7/28/2015 2:47:12 AM Kernel-Power 41 (63) WEIRD!!! Notice no pattern in number of events per day, nor time of day. There is no memory dump being created, the system just reboots as if the power was turned off and back on. When I was in the room with it, (several years ago) the system would beep as it rebooted. Here is the last such event: Log Name: System Source: Microsoft-Windows-Kernel-Power Date: 8/4/2015 6:56:10 AM Event ID: 41 Task Category: (63) Level: Critical Keywords: (2) User: SYSTEM Computer: Azul Description: The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly. Event Xml: 41 2 1 63 0 0x8000000000000002 270735 System Azul 0 0x0 0x0 0x0 0x0 false 0 John W. Colby On 8/8/2015 7:57 AM, James Button wrote: > Guest that! > > Re memory diagnostic - I have found with past experiences of accelerating > frequency of shut-downs, that the system didn't get a chance to record any > events. > And memory checks showed no problems - providing the rest of the system wasn't > being stressed. > > One system I found that removing a memory module - any of them stopped the > shutdowns, and I eventually 'bodged' the system by increasing the memory refresh > by a cycle. It was an old system and a 'new' memory module was, being old tech, > horrendously expensive > That worked for several years, and eventually management agreed the system was > too slow - as in users kept complaining about the system's response, so we were > actually allowed to BUY a new one! > > JimB > From jamesbutton at blueyonder.co.uk Sat Aug 8 07:34:53 2015 From: jamesbutton at blueyonder.co.uk (James Button) Date: Sat, 8 Aug 2015 13:34:53 +0100 Subject: [AccessD] A real puzzler In-Reply-To: <55C5EFD3.7030503@gmail.com> References: <55C56755.9080704@gmail.com> <55C5EFD3.7030503@gmail.com> Message-ID: >From the concentration of bmmrs listed and the changes already done, I'd definitely look at power management as a probable trigger. Re PSU not faulting under 'No load' - unusual I'd agree, and you've 1) changed that, and 2) obviously have a quality one installed It's in a proper place, presumably with lots of 'friends' - and you've had the problem in different locations, so that would rule out external causes. Re ECC - Should deal with actual memory cell problems, but I suspect may not deal with insufficient power or refresh vs read cycles An aside Re drives - if you will use Seagate - check the 4TB 7200.14 (ex barracuda) power usage, or are you into 5 year warrantee ones Re second system - don't you have an almost complete (used) set of the bits needed. Re windows activity - 'Idle-time' indexing of all files on a partition, Idle-time restructure of MFT - maybe event recording might show something, but I'd still be looking at 'power management' BUT - Whatever - I'm still guessing from experiences with older hardware, from (way way) back when I was told I was now the 'Admin' person for the corporate server - 2 x 2GB and 4 x 1GB PATA drives with backup to caddy'd hard drives and CD. JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: Saturday, August 08, 2015 1:02 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A real puzzler The server has had this problem for years including when it was sitting in my office. It is now in a professional "hosting" company in Albany NY, which SUPPOSEDLY has handled all of those power issues for me. It has been progressively worse over the years. The memory has ECC and the motherboard can use it. The power supply was my thought and I have replaced with a huge(er) one. Still could be it of course. The fact that the system reboots under NO LOAD is the puzzler there. I would expect a PS problem to surface under max load. PLUS, in the most recent upgrade, I have DROPPED the number of disks in the system by moving from (16) 1 TB drives to (8) 3 tb drives. While the new drives use slightly more power individually, as a whole it is significantly less. In the course of upgrades I have replaced all disk drives and SSDs. THAT was not a fun task as you can imagine. I had to insert a second RAID controller, add big drives, build out the volumes, and then detach and move the SQL Server data files (and other stuff as well). Then detach the old drives and put on the shelf for awhile, while I tested the whole system. All of which did not affect the problem. I have replaced the power supply with a bigger unit. I have replaced the motherboard. Decided at the least I would have a spare. Have run memory tests. I moved the system into the server room in Albany NY (I live in NC) a couple of years ago when I was working in Raleigh Durham and so, sadly, I cannot just go into the server room and physically work on the system. The up side is that it is in a managed environment with AC / Power / Internet all conditioned. Perhaps I am fixated on and thus can't see past... the system will stay up indefinitely as long as I am flogging the system. When the system is idle it will reboot several times a day. I am pretty well convinced that there is some kind of software issue, and that I should do a windows / SQL Server reinstall. I am terrified of doing that however because of the whole windows / SQL Server "user / security" issue, which I do not fully understand. I could end up with databases that I can no longer access. Not to mention that the server is a thousand miles away in a server room, which makes physically visiting it problematic, and a reinstall definitely requires physical access. And I can't afford to just throw in a second system (it is rather powerful and expensive) to do a clean install on and migrate over to. That is in fact the ultimate solution but ... OMG the cost. John W. Colby On 8/8/2015 4:53 AM, James Button wrote: > Power supply problems - as in maybe external causes - a nearby fridge-freezer > motor/compressor > > Could also be failing memory - triggered by power management of some device > > First - check the power management - anything set to go to idle? > My first physical 'test' would be a second PC on the same supply socket - both > failing points to the external source > Then - add in a voltage recorder - looking for momentary drops may effect one > output of a PSU that is not in the best of condition > Then - maybe replace the PSU > After that - it's going to be memory - maybe pulling individual modules > > JimB > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill > Benson > Sent: Saturday, August 08, 2015 3:36 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] A real puzzler > > Tried uninstalling, wiping registry, reinstalling? Could you still keep > your data if you did that? I have no experience from a dba perspective but > this might be a way of determining whether it is something in your registry > versus potentially a hardware or Bios problem. > > There appear to be some suggestions and analytics here for similar symptoms. > > https://social.technet.microsoft.com/Forums/windowsserver/en-US/1d13ac99-88cf-4e > d1-97d8-7d33d463f111/server-2008-r2-random-reboots-eventid-41 > On Aug 7, 2015 10:21 PM, "John W. Colby" wrote: > >> My SQL Server spontaneously reboots. In the past it was once a month, >> then once week or two. Now it is several times a day. >> >> UNLESS SQL Server is exercised heavily, and then it will not reboot. >> >> That is counter intuitive. >> >> If the issue were a memory issue, SQL Server using all of the memory (and >> it does) would find and trigger such errors. >> If it were a heat issue, SQL Server using all of the processors (and it >> does) would cause more heat. >> >> Etc. >> >> If I stop the service(s) it still reboots. >> >> I am at a loss, not only as to cause, but how to troubleshoot. >> >> Any words of wisdom? >> >> Dual chip mother board. >> Two AMD processors each with 8 cores (15 cores total) >> 80 gigs RAM >> Windows 2008 >> SQL Server 2008 >> >> -- >> John W. Colby >> >> -- >> 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 jamesbutton at blueyonder.co.uk Sat Aug 8 07:46:01 2015 From: jamesbutton at blueyonder.co.uk (James Button) Date: Sat, 8 Aug 2015 13:46:01 +0100 Subject: [AccessD] A real puzzler In-Reply-To: <55C5F2B7.3090806@gmail.com> References: <55C56755.9080704@gmail.com> <1022E1B177C94A4BAC50605960BE881C@XPS> <55C5F2B7.3090806@gmail.com> Message-ID: Another guess - Fans controlled according to CPU loading/temperature - Loading and temp drop causing fans to slow too much, or even the wrong fan? Oh - and headbanging on the door, desk, or wall does not create a good impression with management Neither, apparently does profanity, or anthropomorphic /biological descriptive phrases re. the system, or management who keep asking "Have you fixed it". Although having a 4lb club hammer, and heavy tomes on employment law, and employers legal liability for stress induced violent aberrations, on your desk may get you a break away from work. JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: Saturday, August 08, 2015 1:15 PM To: Access Developers discussion and problem solving; Discussion concerning MS SQL Server Subject: Re: [AccessD] A real puzzler For the last several days I have been flogging away at the system (performing real work), causing the system to stay active. All cores running, 75 (out of 80) GB used for SQL Server. No reboots during that entire time. And yet: Critical 8/4/2015 6:56:10 AM Kernel-Power 41 (63) Critical 8/4/2015 4:42:07 AM Kernel-Power 41 (63) Critical 8/3/2015 10:04:36 PM Kernel-Power 41 (63) Critical 8/3/2015 5:32:06 PM Kernel-Power 41 (63) Critical 8/3/2015 2:22:15 PM Kernel-Power 41 (63) Critical 8/2/2015 3:29:33 PM Kernel-Power 41 (63) Critical 8/2/2015 11:21:46 AM Kernel-Power 41 (63) Critical 8/2/2015 10:51:30 AM Kernel-Power 41 (63) Critical 8/2/2015 7:17:21 AM Kernel-Power 41 (63) Critical 7/31/2015 11:50:45 PM Kernel-Power 41 (63) Critical 7/31/2015 1:05:39 PM Kernel-Power 41 (63) Critical 7/30/2015 10:11:57 PM Kernel-Power 41 (63) Critical 7/30/2015 4:59:26 PM Kernel-Power 41 (63) Critical 7/29/2015 2:32:50 PM Kernel-Power 41 (63) Critical 7/28/2015 5:20:38 PM Kernel-Power 41 (63) Critical 7/28/2015 12:12:57 PM Kernel-Power 41 (63) Critical 7/28/2015 4:15:38 AM Kernel-Power 41 (63) Critical 7/28/2015 2:47:12 AM Kernel-Power 41 (63) WEIRD!!! Notice no pattern in number of events per day, nor time of day. There is no memory dump being created, the system just reboots as if the power was turned off and back on. When I was in the room with it, (several years ago) the system would beep as it rebooted. Here is the last such event: Log Name: System Source: Microsoft-Windows-Kernel-Power Date: 8/4/2015 6:56:10 AM Event ID: 41 Task Category: (63) Level: Critical Keywords: (2) User: SYSTEM Computer: Azul Description: The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly. Event Xml: 41 2 1 63 0 0x8000000000000002 270735 System Azul 0 0x0 0x0 0x0 0x0 false 0 John W. Colby On 8/8/2015 7:57 AM, James Button wrote: > Guest that! > > Re memory diagnostic - I have found with past experiences of accelerating > frequency of shut-downs, that the system didn't get a chance to record any > events. > And memory checks showed no problems - providing the rest of the system wasn't > being stressed. > > One system I found that removing a memory module - any of them stopped the > shutdowns, and I eventually 'bodged' the system by increasing the memory refresh > by a cycle. It was an old system and a 'new' memory module was, being old tech, > horrendously expensive > That worked for several years, and eventually management agreed the system was > too slow - as in users kept complaining about the system's response, so we were > actually allowed to BUY a new one! > > JimB > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bensonforums at gmail.com Sat Aug 8 07:51:30 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 8 Aug 2015 08:51:30 -0400 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> <1022E1B177C94A4BAC50605960BE881C@XPS> <55C5F2B7.3090806@gmail.com> Message-ID: As does asking your superiors what movie theater they and their family like to frequent. On Aug 8, 2015 8:46 AM, "James Button" wrote: > Another guess - > Fans controlled according to CPU loading/temperature - > Loading and temp drop causing fans to slow too much, or even the wrong fan? > > Oh - and headbanging on the door, desk, or wall does not create a good > impression with management > Neither, apparently does profanity, or anthropomorphic /biological > descriptive > phrases re. the system, > or management who keep asking "Have you fixed it". > > Although having a 4lb club hammer, and heavy tomes on employment law, and > employers legal liability for stress induced violent aberrations, on your > desk > may get you a break away from work. > > JimB > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > John W. > Colby > Sent: Saturday, August 08, 2015 1:15 PM > To: Access Developers discussion and problem solving; Discussion > concerning MS > SQL Server > Subject: Re: [AccessD] A real puzzler > > For the last several days I have been flogging away at the system > (performing real work), causing the system to stay active. All cores > running, 75 (out of 80) GB used for SQL Server. No reboots during that > entire time. And yet: > > Critical 8/4/2015 6:56:10 AM Kernel-Power 41 (63) > Critical 8/4/2015 4:42:07 AM Kernel-Power 41 (63) > Critical 8/3/2015 10:04:36 PM Kernel-Power 41 (63) > Critical 8/3/2015 5:32:06 PM Kernel-Power 41 (63) > Critical 8/3/2015 2:22:15 PM Kernel-Power 41 (63) > Critical 8/2/2015 3:29:33 PM Kernel-Power 41 (63) > Critical 8/2/2015 11:21:46 AM Kernel-Power 41 (63) > Critical 8/2/2015 10:51:30 AM Kernel-Power 41 (63) > Critical 8/2/2015 7:17:21 AM Kernel-Power 41 (63) > Critical 7/31/2015 11:50:45 PM Kernel-Power 41 (63) > Critical 7/31/2015 1:05:39 PM Kernel-Power 41 (63) > Critical 7/30/2015 10:11:57 PM Kernel-Power 41 (63) > Critical 7/30/2015 4:59:26 PM Kernel-Power 41 (63) > Critical 7/29/2015 2:32:50 PM Kernel-Power 41 (63) > Critical 7/28/2015 5:20:38 PM Kernel-Power 41 (63) > Critical 7/28/2015 12:12:57 PM Kernel-Power 41 (63) > Critical 7/28/2015 4:15:38 AM Kernel-Power 41 (63) > Critical 7/28/2015 2:47:12 AM Kernel-Power 41 (63) > > WEIRD!!! > > Notice no pattern in number of events per day, nor time of day. There is > no memory dump being created, the system just reboots as if the power > was turned off and back on. When I was in the room with it, (several > years ago) the system would beep as it rebooted. > > Here is the last such event: > > Log Name: System > Source: Microsoft-Windows-Kernel-Power > Date: 8/4/2015 6:56:10 AM > Event ID: 41 > Task Category: (63) > Level: Critical > Keywords: (2) > User: SYSTEM > Computer: Azul > Description: > The system has rebooted without cleanly shutting down first. This error > could be caused if the system stopped responding, crashed, or lost power > unexpectedly. > Event Xml: > > > Guid="{331C3B3A-2005-44C2-AC5E-77220C37D6B4}" /> > 41 > 2 > 1 > 63 > 0 > 0x8000000000000002 > > 270735 > > > System > Azul > > > > 0 > 0x0 > 0x0 > 0x0 > 0x0 > false > 0 > > > > John W. Colby > > On 8/8/2015 7:57 AM, James Button wrote: > > Guest that! > > > > Re memory diagnostic - I have found with past experiences of accelerating > > frequency of shut-downs, that the system didn't get a chance to record > any > > events. > > And memory checks showed no problems - providing the rest of the system > wasn't > > being stressed. > > > > One system I found that removing a memory module - any of them stopped > the > > shutdowns, and I eventually 'bodged' the system by increasing the memory > refresh > > by a cycle. It was an old system and a 'new' memory module was, being old > tech, > > horrendously expensive > > That worked for several years, and eventually management agreed the > system was > > too slow - as in users kept complaining about the system's response, so > we > were > > actually allowed to BUY a new one! > > > > JimB > > > > -- > 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 jwcolby at gmail.com Sat Aug 8 09:26:13 2015 From: jwcolby at gmail.com (John W. Colby) Date: Sat, 8 Aug 2015 10:26:13 -0400 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> <55C5EFD3.7030503@gmail.com> Message-ID: <55C61185.5000704@gmail.com> >An aside Re drives - if you will use Seagate - check the 4TB 7200.14 (ex barracuda) power usage, or are you into 5 year warrantee ones I don't. Have you read this? https://www.backblaze.com/blog/hard-drive-reliability-update-september-2014/ I wouldn't touch Seagate with a ten foot pole, even before reading this. Re second system - don't you have an almost complete (used) set of the bits needed. Well... I used to, but not really. I would need a power supply and server chassis. I have the motherboard and an old (but still functional) Areca Raid Controller. I would need several new hard drives. So chassis and power supply would be about $600-$800. A hand full of 3tb drives would be another $600 or so. Then it depends on whether I want to try splitting the CPU and memory in two and using 1/2 on the new system. I have two physical 8 core AMD processors, so I could move one into the new system. The memory sticks are 8 GB IIRC so I could steal at least 32 gigs from the existing system. And would doing this transfer the problem to the new system? >>Re ECC - Should deal with actual memory cell problems, but I suspect may not deal with insufficient power or refresh vs read cycles Yea, I never really played with the memory stuff. I really just put it in, turned it on and left it running. What I can say is that I always purchased the exact same manufacturer and part number, though as it turns out even then they do change slightly over time. And the system worked reliably for several years. It is entirely possible that it was when I added more memory that the problem started. At first the reboots were very far apart, once a month or even less, so I was never able to really pin down / remember "what I had done last". And why has the frequency of the reboots gradually increased, from once a month to several a day? The whole thing is just strange. John W. Colby On 8/8/2015 8:34 AM, James Button wrote: > >From the concentration of bmmrs listed and the changes already done, I'd > definitely look at power management as a probable trigger. > > Re PSU not faulting under 'No load' - unusual I'd agree, and you've > 1) changed that, and > 2) obviously have a quality one installed > > It's in a proper place, presumably with lots of 'friends' - and you've had the > problem in different locations, > so that would rule out external causes. > > Re ECC - Should deal with actual memory cell problems, but I suspect may not > deal with insufficient power or refresh vs read cycles > > An aside Re drives - if you will use Seagate - check the 4TB 7200.14 (ex > barracuda) power usage, or are you into 5 year warrantee ones > > Re second system - don't you have an almost complete (used) set of the bits > needed. > > Re windows activity - 'Idle-time' indexing of all files on a partition, > Idle-time restructure of MFT - maybe event recording might show something, but > I'd still be looking at 'power management' > > BUT - > Whatever - I'm still guessing from experiences with older hardware, from (way > way) back when I was told I was now the 'Admin' person for the corporate server > - 2 x 2GB and 4 x 1GB PATA drives with backup to caddy'd hard drives and CD. > > JimB > From jwcolby at gmail.com Sat Aug 8 10:00:12 2015 From: jwcolby at gmail.com (John W. Colby) Date: Sat, 8 Aug 2015 11:00:12 -0400 Subject: [AccessD] 2.45 billion rows and counting was PK Cast fails Message-ID: <55C6197C.4010609@gmail.com> The Simmons table I am building now has 2.5 billion rows. The stored procedure is running a "loop" iterating through a table of 228 Simmons demographics definitions, pulling PKs from DB101 (225 million possible PKs) one at a time, and inserting them into the junction table mentioned in the previous email. Sometime last night the log file ran out of room (filled up the log disk) and stopped the process, at Simmons Def 70. Luckily I am writing the individual sql statements out as each one is executed so I could see where it stopped. I cleaned a bunch of very large log files off and restarted this morning. While I can see the total storage (records) in the junction table, what I can't do is get a Max() of the Simmons PK in the junction table to see where I am in the process. I was hoping that info would be in metadata somewhere but apparently not, it seems that it has to scan through the table looking for the max() value. While I haven't let it run in a query window, trying to do that in a view timed out for obvious reasons. And so I wait for completion. I would estimate the junction table will contain somewhere north of 10 billion records when done. I have never even come close to this quantity of records in a single table so I am still unsure whether this will even make things faster. Assuming an index on two fields: PKSimmons - PKs for each of 220 Simmons Definitions PKDB101 - DB101 PKs that match the Simmons Definition Will doing a join on PKDB101 for a single value of PKSimmons return a recordset any time in the useful future? I have to join the PKDB101 to another table (and possibly two), then do WHERE stuff on that other table(s), then count the remaining records to determine which DB101 records match the Simmons definition. This essentially pre-selects just exactly the DB101 records that match the simmons definition, storing the selected DB101 PKs in the junction table. The way I do it right now is just dynamically build a SQL statement, joining everything required, doing a pretty complicated where and counting the resulting records. Rinse and repeat 220 times, once for each Simmons definition. The other question is as follows. I use a BigInt as the PK and make it a defined PK, i.e. the table ends up clustered on that PK. Should I have included the PDSimmons and PKDB101 in that PK so that those two fields are already indexed using the PK index? As it is now, I will be creating a separate (non clustered) index on just those two fields when done. Given that the records are being inserted in the table in PKSimmons order, i.e. an entire set of PK101 values inserted each iteration of my code, one set for each PKSimmons value. So had I used at least the PKSimmons in the (clustered) PK would have it made any difference in performance? Or when doing a join, will the server scan the clustered index anyway and just find all the groups by virtue of the fact that the PK is autonumber and all records for each PKSimmons value are contiguous? The things that keep me up at night. -- John W. Colby From bensonforums at gmail.com Sat Aug 8 10:09:13 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 8 Aug 2015 11:09:13 -0400 Subject: [AccessD] 2.45 billion rows and counting was PK Cast fails In-Reply-To: <55C6197C.4010609@gmail.com> References: <55C6197C.4010609@gmail.com> Message-ID: Can you run a select query ordered by pk desc, and take f Top 1 of that? On Aug 8, 2015 11:01 AM, "John W. Colby" wrote: > The Simmons table I am building now has 2.5 billion rows. The stored > procedure is running a "loop" iterating through a table of 228 Simmons > demographics definitions, pulling PKs from DB101 (225 million possible PKs) > one at a time, and inserting them into the junction table mentioned in the > previous email. Sometime last night the log file ran out of room (filled > up the log disk) and stopped the process, at Simmons Def 70. Luckily I am > writing the individual sql statements out as each one is executed so I > could see where it stopped. I cleaned a bunch of very large log files off > and restarted this morning. > > While I can see the total storage (records) in the junction table, what I > can't do is get a Max() of the Simmons PK in the junction table to see > where I am in the process. I was hoping that info would be in metadata > somewhere but apparently not, it seems that it has to scan through the > table looking for the max() value. While I haven't let it run in a query > window, trying to do that in a view timed out for obvious reasons. > > And so I wait for completion. I would estimate the junction table will > contain somewhere north of 10 billion records when done. > > I have never even come close to this quantity of records in a single table > so I am still unsure whether this will even make things faster. Assuming > an index on two fields: > > PKSimmons - PKs for each of 220 Simmons Definitions > PKDB101 - DB101 PKs that match the Simmons Definition > > Will doing a join on PKDB101 for a single value of PKSimmons return a > recordset any time in the useful future? I have to join the PKDB101 to > another table (and possibly two), then do WHERE stuff on that other > table(s), then count the remaining records to determine which DB101 records > match the Simmons definition. > > This essentially pre-selects just exactly the DB101 records that match the > simmons definition, storing the selected DB101 PKs in the junction table. > > The way I do it right now is just dynamically build a SQL statement, > joining everything required, doing a pretty complicated where and counting > the resulting records. Rinse and repeat 220 times, once for each Simmons > definition. > > The other question is as follows. I use a BigInt as the PK and make it a > defined PK, i.e. the table ends up clustered on that PK. Should I have > included the PDSimmons and PKDB101 in that PK so that those two fields are > already indexed using the PK index? As it is now, I will be creating a > separate (non clustered) index on just those two fields when done. Given > that the records are being inserted in the table in PKSimmons order, i.e. > an entire set of PK101 values inserted each iteration of my code, one set > for each PKSimmons value. So had I used at least the PKSimmons in the > (clustered) PK would have it made any difference in performance? Or when > doing a join, will the server scan the clustered index anyway and just find > all the groups by virtue of the fact that the PK is autonumber and all > records for each PKSimmons value are contiguous? > > The things that keep me up at night. > > -- > John W. Colby > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jamesbutton at blueyonder.co.uk Sat Aug 8 10:38:13 2015 From: jamesbutton at blueyonder.co.uk (James Button) Date: Sat, 8 Aug 2015 16:38:13 +0100 Subject: [AccessD] A real puzzler In-Reply-To: <55C61185.5000704@gmail.com> References: <55C56755.9080704@gmail.com> <55C5EFD3.7030503@gmail.com> <55C61185.5000704@gmail.com> Message-ID: Thanks for the link - Interesting - also noted the 4TB drives are less prone to fail - matching the WD ones. Most of the clients I currently support (I'm supposedly retired) and advise have 1TB or 2TB USB backup drives - advice is have 2 and use them alternately They are a mix of WD and Seagate drives Retail mostly from local superstores ( It's a 'managing agent structure, so dearer drives mean they charge more as their 10% oncost, but they have to absorb the manager's time costs themselves). So I don't know what actual spec drives are inside their black boxes. The duff drives I have been notified about - 2 Seagates and 5 WD's 2 of the WD's within the warrantee period. (Plus another WD one that wouldn't work at all from new.) Interesting (painfull?) that you have opted for the 3 TB drives. Also as they seem to be extracting the drives from USB cases, While I've noted that USB cased drives are frequently cheaper than the 'Internal versions, see my comment re time costs, and not knowing what is inside the black box till you get it open, so I wonder about the quality of the actual drives they are using. Then again, I note their comment re reliability of 'enterprise' vs 'desktop' drives. I'm also a bit confused with the average age of the Seagate 3TB ST3000DM001 7200.14's being 1.9 years - unless that was a really bulky (baulky?) buy. The comments also put interesting slants on the data, and others experiences. Maybe SMART stats are relevant on the basis - any non-nominal stat, means replace the drive NOW! Re spare bits for another system - Major problem, as I see it, is that you ain't got immediate access to the parts in the problematic one, although getting a test system that don't fall over could be a good idea - except for the money, although if it's to be kept with a light load perhaps you wouldn't need all that storage on it. And - as you say "And would doing this transfer the problem to the new system?" Then again, if it did, TRANSFER as opposed to replicate - you'd probably be happier Re. why has the frequency of the reboots gradually increased, from once a month to several a day? If it is memory, then It could be that there is a minor fault in manufacturing of a module - a constriction in a circuit path that is, because of heating due to use - gradually becoming further reduced due to erosion. You'll almost certainly never see that, just a weird effect until it burns out completely, or you remove that module from the system. So if setting up a test system - just move 1 bank at a time - assuming the bank is 2 modules I would also recommend cleaning the contacts - if that attempt wasn't likely to introduce lots of problems in itself. It could be that there is a very small amount of corrosion on contacts - although I'd expect that to have more effect with additional loading. Basically, It's been nice chatting, and I'm glad my problems go along the lines of - Do you want your pet dustbuggy back, Why does your case appear to be lined with magnetic cement dust. Wot - no SATA power connections. You realise upgrading this old system will cost more than a new PC! Yes - The whole thing is just strange. Oh! - yes one of better callouts I got - "The MD's DVD isn't working" - 2 hour drive through London, and - yes the DVD wasn't working, so he couldn't watch the films on his TV. ?30 at local shop for a cheap DVD player - 3 hours to get home (rush-hour(s)) and bill for the whole day+ travel and part with markup. JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: Saturday, August 08, 2015 3:26 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A real puzzler >An aside Re drives - if you will use Seagate - check the 4TB 7200.14 (ex barracuda) power usage, or are you into 5 year warrantee ones I don't. Have you read this? https://www.backblaze.com/blog/hard-drive-reliability-update-september-2014/ I wouldn't touch Seagate with a ten foot pole, even before reading this. The whole thing is just strange. John W. Colby From jwcolby at gmail.com Sat Aug 8 12:39:03 2015 From: jwcolby at gmail.com (John W. Colby) Date: Sat, 8 Aug 2015 13:39:03 -0400 Subject: [AccessD] 2.45 billion rows and counting was PK Cast fails In-Reply-To: References: <55C6197C.4010609@gmail.com> Message-ID: <55C63EB7.2030704@gmail.com> Apparently not. Ordered asc it took about 10 seconds to return the first row. Ordered desc it timed out (as a view). In a query it is off hunting. The issue of course is that it is adding a few thousand records per second and there are (currently) 3 billion records in the table. So I assume that it might eventually figure out top(1), but that is changing every time the log file pushes to the table. I am letting it run. John W. Colby On 8/8/2015 11:09 AM, Bill Benson wrote: > Can you run a select query ordered by pk desc, and take f > Top 1 of that? > On Aug 8, 2015 11:01 AM, "John W. Colby" wrote: > >> The Simmons table I am building now has 2.5 billion rows. The stored >> procedure is running a "loop" iterating through a table of 228 Simmons >> demographics definitions, pulling PKs from DB101 (225 million possible PKs) >> one at a time, and inserting them into the junction table mentioned in the >> previous email. Sometime last night the log file ran out of room (filled >> up the log disk) and stopped the process, at Simmons Def 70. Luckily I am >> writing the individual sql statements out as each one is executed so I >> could see where it stopped. I cleaned a bunch of very large log files off >> and restarted this morning. >> >> While I can see the total storage (records) in the junction table, what I >> can't do is get a Max() of the Simmons PK in the junction table to see >> where I am in the process. I was hoping that info would be in metadata >> somewhere but apparently not, it seems that it has to scan through the >> table looking for the max() value. While I haven't let it run in a query >> window, trying to do that in a view timed out for obvious reasons. >> >> And so I wait for completion. I would estimate the junction table will >> contain somewhere north of 10 billion records when done. >> >> I have never even come close to this quantity of records in a single table >> so I am still unsure whether this will even make things faster. Assuming >> an index on two fields: >> >> PKSimmons - PKs for each of 220 Simmons Definitions >> PKDB101 - DB101 PKs that match the Simmons Definition >> >> Will doing a join on PKDB101 for a single value of PKSimmons return a >> recordset any time in the useful future? I have to join the PKDB101 to >> another table (and possibly two), then do WHERE stuff on that other >> table(s), then count the remaining records to determine which DB101 records >> match the Simmons definition. >> >> This essentially pre-selects just exactly the DB101 records that match the >> simmons definition, storing the selected DB101 PKs in the junction table. >> >> The way I do it right now is just dynamically build a SQL statement, >> joining everything required, doing a pretty complicated where and counting >> the resulting records. Rinse and repeat 220 times, once for each Simmons >> definition. >> >> The other question is as follows. I use a BigInt as the PK and make it a >> defined PK, i.e. the table ends up clustered on that PK. Should I have >> included the PDSimmons and PKDB101 in that PK so that those two fields are >> already indexed using the PK index? As it is now, I will be creating a >> separate (non clustered) index on just those two fields when done. Given >> that the records are being inserted in the table in PKSimmons order, i.e. >> an entire set of PK101 values inserted each iteration of my code, one set >> for each PKSimmons value. So had I used at least the PKSimmons in the >> (clustered) PK would have it made any difference in performance? Or when >> doing a join, will the server scan the clustered index anyway and just find >> all the groups by virtue of the fact that the PK is autonumber and all >> records for each PKSimmons value are contiguous? >> >> The things that keep me up at night. >> >> -- >> John W. Colby >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From jwcolby at gmail.com Sat Aug 8 12:49:50 2015 From: jwcolby at gmail.com (John W. Colby) Date: Sat, 8 Aug 2015 13:49:50 -0400 Subject: [AccessD] A real puzzler In-Reply-To: References: <55C56755.9080704@gmail.com> <55C5EFD3.7030503@gmail.com> <55C61185.5000704@gmail.com> Message-ID: <55C6413E.2050407@gmail.com> I built my system long before ever reading this article. I used WD black because all of the user feedback put that drive in the high reliability segment, Seagates always had miserable reliability, just in the things like newegg and amazon where I could get actual user feedback. As for this article, they were buying drives in cases back when the big floods in Thailand caused shortages. I don't think that is a practice that they follow in normal times. >>Most of the clients I currently support (I'm supposedly retired) and advise have 1TB or 2TB USB backup drives - advice is have 2 and use them alternately LOL my drives are formed into raid arrays of some huge size then volumes carved out of that for various purposes. I could and should pull database backups out onto normal usb drives, however trying to backup over usb for 3 tb of data is pretty painful all by itself. Your DVD story is too funny! A nice pleasant way to make a days wages I guess. Very expensive movie. John W. Colby On 8/8/2015 11:38 AM, James Button wrote: > Thanks for the link - > > Interesting - also noted the 4TB drives are less prone to fail - matching the WD > ones. > Most of the clients I currently support (I'm supposedly retired) and advise have > 1TB or 2TB USB backup drives - advice is have 2 and use them alternately > They are a mix of WD and Seagate drives Retail mostly from local superstores ( > It's a 'managing agent structure, so dearer drives mean they charge more as > their 10% oncost, but they have to absorb the manager's time costs themselves). > > So I don't know what actual spec drives are inside their black boxes. > The duff drives I have been notified about - 2 Seagates and 5 WD's > 2 of the WD's within the warrantee period. (Plus another WD one that wouldn't > work at all from new.) > > Interesting (painfull?) that you have opted for the 3 TB drives. > Also as they seem to be extracting the drives from USB cases, While I've noted > that USB cased drives are frequently cheaper than the 'Internal versions, see my > comment re time costs, and not knowing what is inside the black box till you get > it open, so I wonder about the quality of the actual drives they are using. > Then again, I note their comment re reliability of 'enterprise' vs 'desktop' > drives. > I'm also a bit confused with the average age of the Seagate 3TB ST3000DM001 > 7200.14's being 1.9 years - unless that was a really bulky (baulky?) buy. > > The comments also put interesting slants on the data, and others experiences. > Maybe SMART stats are relevant on the basis - any non-nominal stat, means > replace the drive NOW! > > Re spare bits for another system - Major problem, as I see it, is that you ain't > got immediate access to the parts in the problematic one, although getting a > test system that don't fall over could be a good idea - except for the money, > although if it's to be kept with a light load perhaps you wouldn't need all that > storage on it. > > And - as you say "And would doing this transfer the problem to the new system?" > > Then again, if it did, TRANSFER as opposed to replicate - you'd probably be > happier > > Re. why has the frequency of the reboots gradually increased, from once a month > to several a day? > If it is memory, then > It could be that there is a minor fault in manufacturing of a module - a > constriction in a circuit path that is, because of heating due to use - > gradually becoming further reduced due to erosion. > You'll almost certainly never see that, just a weird effect until it burns out > completely, or you remove that module from the system. > So if setting up a test system - just move 1 bank at a time - assuming the bank > is 2 modules > I would also recommend cleaning the contacts - if that attempt wasn't likely to > introduce lots of problems in itself. > It could be that there is a very small amount of corrosion on contacts - > although I'd expect that to have more effect with additional loading. > > > Basically, It's been nice chatting, and I'm glad my problems go along the lines > of - > Do you want your pet dustbuggy back, > Why does your case appear to be lined with magnetic cement dust. > Wot - no SATA power connections. > You realise upgrading this old system will cost more than a new PC! > > > Yes - > The whole thing is just strange. > > > > Oh! - yes one of better callouts I got - > "The MD's DVD isn't working" > - 2 hour drive through London, and - yes the DVD wasn't working, so he couldn't > watch the films on his TV. > ?30 at local shop for a cheap DVD player - 3 hours to get home (rush-hour(s)) > and bill for the whole day+ travel and part with markup. > > > JimB > > From jwcolby at gmail.com Sun Aug 9 22:06:26 2015 From: jwcolby at gmail.com (John W. Colby) Date: Sun, 9 Aug 2015 23:06:26 -0400 Subject: [AccessD] Billions and billions of rows Message-ID: <55C81532.3070905@gmail.com> So the table ended up with 7 billion rows and a combined 320 gb data and index space. I decided to rebuild the table using just the FKs (PKSimmons and PKDB101), and a PK of those two fields combined. I also compressed the index (page). It is unclear how much compression I will get since the data being compressed are two integer FK fields. All just scientific inquiry. :) I can say however that the Index storage is almost nothing. So I ran a count on the first attempt at this junction table, selecting just the second PKSimmons and the time was 1.5 minutes vs just over 2 minutes for doing it the old (hard coded) way. Not a significant savings I must admit. That was with a noncompressed / non clustered index however. We shall see whether a single compressed / clustered index will speed things up. Of course it is likely to take me another day to yank the two FK fields out of the first table and insert into the new table (insert into / select). -- John W. Colby From gustav at cactus.dk Mon Aug 10 05:15:34 2015 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 10 Aug 2015 10:15:34 +0000 Subject: [AccessD] PITA and temporal database (was: Access and SQL Server) Message-ID: Hi Arthur et al As you may have observed, the new SQL Server 2016 brings in temporal storage at a basic level: https://channel9.msdn.com/Shows/Data-Exposed/Temporal-in-SQL-Server-2016 https://www.mssqltips.com/sqlservertip/3680/introduction-to-sql-server-2016-temporal-tables/ It has several limitations but may serve some applications well. The interesting part is that referential integrity is partly possible as historical records are automatically moved to a "twin table" which enables RI with the newest record only. /gustav -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Gustav Brock Sendt: 8. marts 2011 12:42 Til: accessd at databaseadvisors.com Emne: Re: [AccessD] PITA and temporal database (was: Access and SQL Server) Hi Arthur This is what you brought up 4? years ago: --- >>> artful at rogers.com 2006-11-22 13:14:50 >>> There is a whole other subject on this, about which I have written, but I googled it and it didn't come up, so perhaps I wrote it and forgot to sell it to somebody. The gist is this: it's called PITA, which doesn't mean pain in the arse, but rather Point In Time Architecture. Without PITA, the central problem with relational databases is that they don't provide an instant "roll back to August 1" capability. With PITA, they do. It's not all that complicated, but it does require a detailed walk-through so you can understand all the implications, the most critical of which is, "Nothing is ever updated. An updated row is actually replaced, and the updated row's EndDate column is updated to reflect the datetime on which the row was "changed". Thus it becomes possible to issue a query that reflects the state of the database on August 1, 2005. Obviously this increases the size of the db significantly, but in certain environments (such as medical), this is critical -- who was JWC's physician on that date, and what tests were performed, and by which medicos, and so on. So. Today's job is to dig out that PITA article and pitch it to somebody. --- Somehow you must have succeeded because your writing can found here, dated 2007-02-22: http://www.simple-talk.com/sql/database-administration/database-design-a-point-in-time-architecture/ As I wrote back also on 2006-11-22, what you describe is a temporal database or - more precise - a bitemporal: In the literature, two time lines of interest have been mentioned, transaction time and valid time. The valid time line represents when a fact is valid in modelled world (i.e. when it was believed) and the transaction time line represents when a transaction was performed. A bitemporal database is a combination of valid time and transaction time databases where these two time lines are considered to be orthogonal. (Snodgrass & Ahn 1986) This is a fascinating area, and your article describes nicely how - using SQL Server - to deal with some of the issues for a practical implementation of this theory (from 1986). However, I miss the connection to your eggs. To me, the collection of eggs describes rather a batch: A given population of 200 hens produce each day a collected batch of eggs which perhaps are stamped with a producer id and batch id but at least packed with other eggs from the same batch only. The batch id is written on the package. This way a bad egg at the consumer can be tracked back to the package, the producer, the date, the packing machine, the population of hens, and - perhaps - the possible bags of corn (or whatever) used to feed these hens. You will record all associated data in a write-once/read-many database, but as you by definition never will change or correct these data, I see no scenario for a temporal or PITA database, it's more like a log file. The only date field needed here is the packing date. And how about the autonumber and the index maintenance Jim brought up? /gustav >>> fuller.artful at gmail.com 08-03-2011 01:00 >>> Let us distinguish two problems: The first is the "egg" problem. I have 200 chickens each of which lays several eggs per day, each of which is plonked into an arbitrary-numbered case. At some point, it may be interesting to know which chicken laid which eggs and into which cartons they were placed. Most often, this level of detail is not interesting, but occasionally it is vital and potentially life-saving. The second is the "serial number" problem. Every crankshaft or windshield or manifold coming off an assembly line has a unique serial number, unlike the aforementioned eggs. Each one of these parts can be traced to a shift and a line and perhaps ultimately to a worker. Big difference in these problems, and big difference in which attributes we choose to model. IME, I have dealt more with the egg problem than the serial number problem, but in recent years this has changed. To further complicate things, this latter problem has been compounded by the PITA issue (Point in Time Archictecture; for details on this problem and its solution see my piece at Red Gate's site). Arthur From RockySmolin at bchacc.com Thu Aug 13 23:48:35 2015 From: RockySmolin at bchacc.com (RockySmolin at bchacc.com) Date: Thu, 13 Aug 2015 21:48:35 -0700 Subject: [AccessD] SAP IDoc Message-ID: <20150813214835.86c3debdd1c3983866efe200e2feb95f.088b58ee5d.wbe@email04.secureserver.net> Anybody know SAP idoc mapping tool? If so contact me off line. Potential contract. Rocky From RockySmolin at bchacc.com Thu Aug 13 23:50:33 2015 From: RockySmolin at bchacc.com (RockySmolin at bchacc.com) Date: Thu, 13 Aug 2015 21:50:33 -0700 Subject: [AccessD] Access on a MAC Message-ID: <20150813215033.86c3debdd1c3983866efe200e2feb95f.973d315d30.wbe@email04.secureserver.net> Dear List: Is there anything better than Parallels for running Access on a MAC? TIA Rocky From darryl at whittleconsulting.com.au Thu Aug 13 23:56:53 2015 From: darryl at whittleconsulting.com.au (Darryl Collins) Date: Fri, 14 Aug 2015 04:56:53 +0000 Subject: [AccessD] Access on a MAC In-Reply-To: <20150813215033.86c3debdd1c3983866efe200e2feb95f.973d315d30.wbe@email04.secureserver.net> References: <20150813215033.86c3debdd1c3983866efe200e2feb95f.973d315d30.wbe@email04.secureserver.net> Message-ID: Do you mean generally (as in any ol windows VM) or you are looking for alternatives to Parallells specifically? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of RockySmolin at bchacc.com Sent: Friday, 14 August 2015 2:51 PM To: accessd at databaseadvisors.com Subject: [AccessD] Access on a MAC Dear List: Is there anything better than Parallels for running Access on a MAC? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From RockySmolin at bchacc.com Fri Aug 14 00:52:13 2015 From: RockySmolin at bchacc.com (RockySmolin at bchacc.com) Date: Thu, 13 Aug 2015 22:52:13 -0700 Subject: [AccessD] Access on a MAC Message-ID: <20150813225213.86c3debdd1c3983866efe200e2feb95f.a2c90ad088.wbe@email04.secureserver.net> -------- Original Message -------- Subject: RE: [AccessD] Access on a MAC From: Date: Thu, August 13, 2015 10:33 pm To: "Access Developers discussion and problem solving" Anything that will allow Access to run on a Mac. r -------- Original Message -------- Subject: Re: [AccessD] Access on a MAC From: Darryl Collins Date: Thu, August 13, 2015 9:56 pm To: Access Developers discussion and problem solving Do you mean generally (as in any ol windows VM) or you are looking for alternatives to Parallells specifically? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of RockySmolin at bchacc.com Sent: Friday, 14 August 2015 2:51 PM To: accessd at databaseadvisors.com Subject: [AccessD] Access on a MAC Dear List: Is there anything better than Parallels for running Access on a MAC? TIA Rocky -- 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 darryl at whittleconsulting.com.au Fri Aug 14 00:56:25 2015 From: darryl at whittleconsulting.com.au (Darryl Collins) Date: Fri, 14 Aug 2015 05:56:25 +0000 Subject: [AccessD] Access on a MAC In-Reply-To: <20150813225213.86c3debdd1c3983866efe200e2feb95f.a2c90ad088.wbe@email04.secureserver.net> References: <20150813225213.86c3debdd1c3983866efe200e2feb95f.a2c90ad088.wbe@email04.secureserver.net> Message-ID: This maybe useful: http://www.macworld.com/article/1164817/the_best_way_to_run_windows_on_your_mac.html -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of RockySmolin at bchacc.com Sent: Friday, 14 August 2015 3:52 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access on a MAC -------- Original Message -------- Subject: RE: [AccessD] Access on a MAC From: Date: Thu, August 13, 2015 10:33 pm To: "Access Developers discussion and problem solving" Anything that will allow Access to run on a Mac. r -------- Original Message -------- Subject: Re: [AccessD] Access on a MAC From: Darryl Collins Date: Thu, August 13, 2015 9:56 pm To: Access Developers discussion and problem solving Do you mean generally (as in any ol windows VM) or you are looking for alternatives to Parallells specifically? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of RockySmolin at bchacc.com Sent: Friday, 14 August 2015 2:51 PM To: accessd at databaseadvisors.com Subject: [AccessD] Access on a MAC Dear List: Is there anything better than Parallels for running Access on a MAC? TIA Rocky -- 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 RockySmolin at bchacc.com Fri Aug 14 01:08:29 2015 From: RockySmolin at bchacc.com (RockySmolin at bchacc.com) Date: Thu, 13 Aug 2015 23:08:29 -0700 Subject: [AccessD] Access on a MAC Message-ID: <20150813230829.86c3debdd1c3983866efe200e2feb95f.fff66d23eb.wbe@email04.secureserver.net> Very. Thanks. r -------- Original Message -------- Subject: Re: [AccessD] Access on a MAC From: Darryl Collins Date: Thu, August 13, 2015 10:56 pm To: Access Developers discussion and problem solving This maybe useful: http://www.macworld.com/article/1164817/the_best_way_to_run_windows_on_your_mac.html -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of RockySmolin at bchacc.com Sent: Friday, 14 August 2015 3:52 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access on a MAC -------- Original Message -------- Subject: RE: [AccessD] Access on a MAC From: Date: Thu, August 13, 2015 10:33 pm To: "Access Developers discussion and problem solving" Anything that will allow Access to run on a Mac. r -------- Original Message -------- Subject: Re: [AccessD] Access on a MAC From: Darryl Collins Date: Thu, August 13, 2015 9:56 pm To: Access Developers discussion and problem solving Do you mean generally (as in any ol windows VM) or you are looking for alternatives to Parallells specifically? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of RockySmolin at bchacc.com Sent: Friday, 14 August 2015 2:51 PM To: accessd at databaseadvisors.com Subject: [AccessD] Access on a MAC Dear List: Is there anything better than Parallels for running Access on a MAC? TIA Rocky -- 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 bensonforums at gmail.com Fri Aug 14 08:05:11 2015 From: bensonforums at gmail.com (Bill Benson) Date: Fri, 14 Aug 2015 09:05:11 -0400 Subject: [AccessD] Access on a MAC In-Reply-To: <20150813230829.86c3debdd1c3983866efe200e2feb95f.fff66d23eb.wbe@email04.secureserver.net> References: <20150813230829.86c3debdd1c3983866efe200e2feb95f.fff66d23eb.wbe@email04.secureserver.net> Message-ID: I did not read the link (phone here) but virtual machine comes to mind. On Aug 14, 2015 2:09 AM, wrote: > Very. Thanks. > > r > > > > -------- Original Message -------- > Subject: Re: [AccessD] Access on a MAC > From: Darryl Collins > Date: Thu, August 13, 2015 10:56 pm > To: Access Developers discussion and problem solving > > > This maybe useful: > > > http://www.macworld.com/article/1164817/the_best_way_to_run_windows_on_your_mac.html > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > RockySmolin at bchacc.com > Sent: Friday, 14 August 2015 3:52 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access on a MAC > > > > > -------- Original Message -------- > Subject: RE: [AccessD] Access on a MAC > From: > Date: Thu, August 13, 2015 10:33 pm > To: "Access Developers discussion and problem solving" > > > Anything that will allow Access to run on a Mac. > > > r > > > -------- Original Message -------- > Subject: Re: [AccessD] Access on a MAC > From: Darryl Collins > Date: Thu, August 13, 2015 9:56 pm > To: Access Developers discussion and problem solving > > > Do you mean generally (as in any ol windows VM) or you are looking for > alternatives to Parallells specifically? > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of RockySmolin at bchacc.com > Sent: Friday, 14 August 2015 2:51 PM > To: accessd at databaseadvisors.com > Subject: [AccessD] Access on a MAC > > Dear List: > > Is there anything better than Parallels for running Access on a MAC? > > TIA > > Rocky > > -- > 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 carbonnb at gmail.com Fri Aug 14 13:17:19 2015 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Fri, 14 Aug 2015 14:17:19 -0400 Subject: [AccessD] Access on a MAC In-Reply-To: <20150813215033.86c3debdd1c3983866efe200e2feb95f.973d315d30.wbe@email04.secureserver.net> References: <20150813215033.86c3debdd1c3983866efe200e2feb95f.973d315d30.wbe@email04.secureserver.net> Message-ID: When I was still at CBC, we used VMWare Fusion to run Windows in a VM on the MAC. I used the Adobe Creative Suite extensively in Windows on the Mac. I also did run Office 2010 Pro in the VM with no problems. B On Fri, Aug 14, 2015 at 12:50 AM, wrote: > Dear List: > > Is there anything better than Parallels for running Access on a MAC? > > TIA > > Rocky > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From dbdoug at gmail.com Fri Aug 14 14:33:22 2015 From: dbdoug at gmail.com (Doug Steele) Date: Fri, 14 Aug 2015 12:33:22 -0700 Subject: [AccessD] Access on a MAC In-Reply-To: References: <20150813215033.86c3debdd1c3983866efe200e2feb95f.973d315d30.wbe@email04.secureserver.net> Message-ID: I do all my Access development on Macs. I use both VMWare Fusion and Parallels. They both work pretty well; my impression of the latest version of Parallels is that file access is slower than Fusion, but it's not a big deal. Doug On Fri, Aug 14, 2015 at 11:17 AM, Bryan Carbonnell wrote: > > Is there anything better than Parallels for running Access on a MAC? From RockySmolin at bchacc.com Fri Aug 14 16:26:56 2015 From: RockySmolin at bchacc.com (RockySmolin at bchacc.com) Date: Fri, 14 Aug 2015 14:26:56 -0700 Subject: [AccessD] Access on a MAC Message-ID: <20150814142656.86c3debdd1c3983866efe200e2feb95f.15f29720af.wbe@email04.secureserver.net> Thanks - will forward. r -------- Original Message -------- Subject: Re: [AccessD] Access on a MAC From: Bryan Carbonnell Date: Fri, August 14, 2015 11:17 am To: Access Developers discussion and problem solving When I was still at CBC, we used VMWare Fusion to run Windows in a VM on the MAC. I used the Adobe Creative Suite extensively in Windows on the Mac. I also did run Office 2010 Pro in the VM with no problems. B On Fri, Aug 14, 2015 at 12:50 AM, wrote: > Dear List: > > Is there anything better than Parallels for running Access on a MAC? > > TIA > > Rocky > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From RockySmolin at bchacc.com Fri Aug 14 16:33:06 2015 From: RockySmolin at bchacc.com (RockySmolin at bchacc.com) Date: Fri, 14 Aug 2015 14:33:06 -0700 Subject: [AccessD] Access on a MAC Message-ID: <20150814143306.86c3debdd1c3983866efe200e2feb95f.8ec6c2d438.wbe@email04.secureserver.net> Thanks - will forward. I've got a Mac that I don't use but have always wanted to find a reason to do it. My secondary backup up box is old and slow(like me :)) and I was thinking about replacing it. Maybe I'll get Fusion and set up a test bed. r -------- Original Message -------- Subject: Re: [AccessD] Access on a MAC From: Doug Steele Date: Fri, August 14, 2015 12:33 pm To: Access Developers discussion and problem solving I do all my Access development on Macs. I use both VMWare Fusion and Parallels. They both work pretty well; my impression of the latest version of Parallels is that file access is slower than Fusion, but it's not a big deal. Doug On Fri, Aug 14, 2015 at 11:17 AM, Bryan Carbonnell wrote: > > Is there anything better than Parallels for running Access on a MAC? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From darren at activebilling.com.au Thu Aug 20 19:34:52 2015 From: darren at activebilling.com.au (Darren - Active Billing) Date: Fri, 21 Aug 2015 10:34:52 +1000 Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb Message-ID: Hi Team if I had a field with the following blurb... Dear [FirstName], Today is [NameOfDay] and the date is the [DateOfMonth] of [NameOfMonth]. Kind Regards, {SignatoryName} I can see in that blurb there are 5 tokens surrounded by Square and or Curley brackets. How could I run though that text and build a list of the 5 tokens such that I can produce a list/array like... [FirstName] [NameOfDay] [DateOfMonth] [NameOfMonth] {SignatoryName} Many thanks in advance. Darren From darryl at whittleconsulting.com.au Thu Aug 20 19:57:01 2015 From: darryl at whittleconsulting.com.au (Darryl Collins) Date: Fri, 21 Aug 2015 00:57:01 +0000 Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb In-Reply-To: References: Message-ID: If the 'fixed' text is consistent for every entry, I would take the opposite approach and remove it. Then what you have left is the data you are seeking to extract. For example. First line .replace("Dear",vbnullstring) And all you have left is the [FirstName] Cheers Darryl -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren - Active Billing Sent: Friday, 21 August 2015 10:35 AM To: Access Developers discussion and problem solving Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb Hi Team if I had a field with the following blurb... Dear [FirstName], Today is [NameOfDay] and the date is the [DateOfMonth] of [NameOfMonth]. Kind Regards, {SignatoryName} I can see in that blurb there are 5 tokens surrounded by Square and or Curley brackets. How could I run though that text and build a list of the 5 tokens such that I can produce a list/array like... [FirstName] [NameOfDay] [DateOfMonth] [NameOfMonth] {SignatoryName} Many thanks in advance. Darren -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From darren at activebilling.com.au Thu Aug 20 22:05:56 2015 From: darren at activebilling.com.au (Darren - Active Billing) Date: Fri, 21 Aug 2015 13:05:56 +1000 Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb In-Reply-To: References: Message-ID: <7FFA2146-4E57-4912-BD63-1B67755C5055@activebilling.com.au> Hi Daz, Thanks for the reply. No, the blurbs are all different about (30 of them) with differing tokens. Just wanted to know if I could scan each blurb and build a token list from each blurb. thanks D > On 21 Aug 2015, at 10:57 am, Darryl Collins wrote: > > If the 'fixed' text is consistent for every entry, I would take the opposite approach and remove it. Then what you have left is the data you are seeking to extract. > > For example. First line > > .replace("Dear",vbnullstring) > > And all you have left is the [FirstName] > > Cheers > Darryl > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren - Active Billing > Sent: Friday, 21 August 2015 10:35 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb > > Hi Team > > if I had a field with the following blurb... > > Dear [FirstName], > Today is [NameOfDay] and the date is the [DateOfMonth] of [NameOfMonth]. > Kind Regards, > {SignatoryName} > > I can see in that blurb there are 5 tokens surrounded by Square and or Curley brackets. > How could I run though that text and build a list of the 5 tokens such that I can produce a list/array like... > > [FirstName] > [NameOfDay] > [DateOfMonth] > [NameOfMonth] > {SignatoryName} > > Many thanks in advance. > > Darren > > -- > 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 darryl at whittleconsulting.com.au Thu Aug 20 22:37:40 2015 From: darryl at whittleconsulting.com.au (Darryl Collins) Date: Fri, 21 Aug 2015 03:37:40 +0000 Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb In-Reply-To: <7FFA2146-4E57-4912-BD63-1B67755C5055@activebilling.com.au> References: <7FFA2146-4E57-4912-BD63-1B67755C5055@activebilling.com.au> Message-ID: Aaaah, bugger. Thought I had a easy solution for you.. Are you working with the actual output text (so sans token brackets)? -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren - Active Billing Sent: Friday, 21 August 2015 1:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A2003 - Build a List/Array from Tokens in a blurb Hi Daz, Thanks for the reply. No, the blurbs are all different about (30 of them) with differing tokens. Just wanted to know if I could scan each blurb and build a token list from each blurb. thanks D > On 21 Aug 2015, at 10:57 am, Darryl Collins wrote: > > If the 'fixed' text is consistent for every entry, I would take the opposite approach and remove it. Then what you have left is the data you are seeking to extract. > > For example. First line > > .replace("Dear",vbnullstring) > > And all you have left is the [FirstName] > > Cheers > Darryl > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren - Active Billing > Sent: Friday, 21 August 2015 10:35 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb > > Hi Team > > if I had a field with the following blurb... > > Dear [FirstName], > Today is [NameOfDay] and the date is the [DateOfMonth] of [NameOfMonth]. > Kind Regards, > {SignatoryName} > > I can see in that blurb there are 5 tokens surrounded by Square and or Curley brackets. > How could I run though that text and build a list of the 5 tokens such that I can produce a list/array like... > > [FirstName] > [NameOfDay] > [DateOfMonth] > [NameOfMonth] > {SignatoryName} > > Many thanks in advance. > > Darren > > -- > 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 paul.hartland at googlemail.com Fri Aug 21 01:12:43 2015 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 21 Aug 2015 07:12:43 +0100 Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb In-Reply-To: References: <7FFA2146-4E57-4912-BD63-1B67755C5055@activebilling.com.au> Message-ID: My approach would be to use a loop using instr to find the sqaure brackets and pull them out that way, on way to work at moment but if need some code example i should be able to do something tomorrow On 21 Aug 2015 04:38, "Darryl Collins" wrote: > Aaaah, bugger. Thought I had a easy solution for you.. > > Are you working with the actual output text (so sans token brackets)? > > > > > > -----Original Message----- > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Darren - Active Billing > Sent: Friday, 21 August 2015 1:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] A2003 - Build a List/Array from Tokens in a blurb > > Hi Daz, > > Thanks for the reply. No, the blurbs are all different about (30 of them) > with differing tokens. > Just wanted to know if I could scan each blurb and build a token list from > each blurb. > > > thanks > > D > > > On 21 Aug 2015, at 10:57 am, Darryl Collins < > darryl at whittleconsulting.com.au> wrote: > > > > If the 'fixed' text is consistent for every entry, I would take the > opposite approach and remove it. Then what you have left is the data you > are seeking to extract. > > > > For example. First line > > > > .replace("Dear",vbnullstring) > > > > And all you have left is the [FirstName] > > > > Cheers > > Darryl > > > > > > > > -----Original Message----- > > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf > Of Darren - Active Billing > > Sent: Friday, 21 August 2015 10:35 AM > > To: Access Developers discussion and problem solving > > Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb > > > > Hi Team > > > > if I had a field with the following blurb... > > > > Dear [FirstName], > > Today is [NameOfDay] and the date is the [DateOfMonth] of [NameOfMonth]. > > Kind Regards, > > {SignatoryName} > > > > I can see in that blurb there are 5 tokens surrounded by Square and or > Curley brackets. > > How could I run though that text and build a list of the 5 tokens such > that I can produce a list/array like... > > > > [FirstName] > > [NameOfDay] > > [DateOfMonth] > > [NameOfMonth] > > {SignatoryName} > > > > Many thanks in advance. > > > > Darren > > > > -- > > 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 gustav at cactus.dk Fri Aug 21 03:52:06 2015 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 21 Aug 2015 08:52:06 +0000 Subject: [AccessD] A2003 - Build a List/Array from Tokens in a blurb Message-ID: Hi Darren Split is your friend: Public Function SplitTokens(ByVal Message As String) As String() Dim Parts As Variant Dim Tokens() As String Dim Token As Integer ' Split into first parts. Parts = Split(Message, "[") If UBound(Parts) <= 0 Then ' Return array with LBound = 0. ReDim Tokens(0) Else ' Return array with LBound = 1. ' Clean parts and fill array. ReDim Tokens(1 To UBound(Parts)) For Token = 1 + LBound(Parts) To UBound(Parts) Tokens(Token) = "[" & Split(Parts(Token), "]", 2)(0) & "]" Next ' Split into second parts. Parts = Split(Message, "{") If UBound(Parts) > 0 Then ' Clean parts and append to array. ReDim Preserve Tokens(1 To UBound(Tokens) + UBound(Parts)) For Token = 1 + LBound(Parts) To UBound(Parts) Tokens(UBound(Tokens) - 1 + Token) = "{" & Split(Parts(Token), "}", 2)(0) & "}" Next End If ' Return array with LBound = 1. End If SplitTokens = Tokens End Function /gustav -----Oprindelig meddelelse----- Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Darren - Active Billing Sendt: 21. august 2015 02:35 Til: Access Developers discussion and problem solving Emne: [AccessD] A2003 - Build a List/Array from Tokens in a blurb Hi Team if I had a field with the following blurb... Dear [FirstName], Today is [NameOfDay] and the date is the [DateOfMonth] of [NameOfMonth]. Kind Regards, {SignatoryName} I can see in that blurb there are 5 tokens surrounded by Square and or Curley brackets. How could I run though that text and build a list of the 5 tokens such that I can produce a list/array like... [FirstName] [NameOfDay] [DateOfMonth] [NameOfMonth] {SignatoryName} Many thanks in advance. Darren From jwcolby at gmail.com Fri Aug 21 11:25:30 2015 From: jwcolby at gmail.com (John W. Colby) Date: Fri, 21 Aug 2015 12:25:30 -0400 Subject: [AccessD] Billions and billions of rows In-Reply-To: <55C81532.3070905@gmail.com> References: <55C81532.3070905@gmail.com> Message-ID: <55D750FA.6010103@gmail.com> Just an update, after rebuilding this as a pair of fields - FKDB101 / FKSimmons (Int), set as the PK (clustered index) and compressed (page), the total storage dropped to just the storage of the data (compressed) and a tiny little amount (a hundred mbytes?) that SQL Server uses for something index related. The time to get counts has dropped by an order of magnitude. Just to recap, previously I would look up in a Simmons Definition table what operations were required to "translate" a given field in DB101 to a corresponding field in Simmons. Simmons has 220 defined "fields" which are "translated from DB101 and mapped into Simmons". Just as an example, I have a single age field. Simmons has (IIRC) 5 year age brackets. So to count people in simmons age bracket 30-35 I would pull all records with an age between 30 and 35 and count them. From that example you can see that to get that specific Simmons count I had to dynamically create SQL and perform a count on the pulled set of records. Given that, the counts for each simmons data point took around 3.5 minutes to define the dynamic sql (not particularly time intensive) and then pull and count the required records against the full DB101 data set (220 million records). And of course the actual time varied all over the map, but that was the average. So what I did was "preselect" the records that fit each simmons data point and stored it in this new junction table a pair of fields - FKDB101 / FKSimmons (Int) So now, while I still have to perform joins on at least one other table, the join is between the already selected PKDB101 set and another table. The results are lightning fast, with each count requiring about 9 seconds (average for junction table) instead of about 3.5 minutes (dynamic sql). I can now do my entire count of all 220 Simmons data points in around 30 minutes instead of days. The junction table contains just over seven billion records. DB101 contains about 220 million records and several hundred fields. The Simmons table contains 228 records, each record mapping one specific DB101 field into a similar Simmons "field". The simmons information is then further filtered on other (non simmons) fields in DB101, for example simmons counts against people with diabetes, or people who are jewish, or people who go cruising. SQL Server is very efficient in determining how to select the various parts of a query to optimize the retrieval of the result set, so it tends to preselect the jewish (for example) records and then only perform the "simmons stuff" against that much smaller result set. What this means is that using either method (old dynamic sql or new junction table) the actual time to get the counts will be reduced by the "other selection" criteria. But the junction table method still wins hands down in time to completion. John W. Colby On 8/9/2015 11:06 PM, John W. Colby wrote: > So the table ended up with 7 billion rows and a combined 320 gb data > and index space. > > I decided to rebuild the table using just the FKs (PKSimmons and > PKDB101), and a PK of those two fields combined. I also compressed > the index (page). It is unclear how much compression I will get since > the data being compressed are two integer FK fields. All just > scientific inquiry. :) > > I can say however that the Index storage is almost nothing. > > So I ran a count on the first attempt at this junction table, > selecting just the second PKSimmons and the time was 1.5 minutes vs > just over 2 minutes for doing it the old (hard coded) way. Not a > significant savings I must admit. That was with a noncompressed / non > clustered index however. We shall see whether a single compressed / > clustered index will speed things up. Of course it is likely to take > me another day to yank the two FK fields out of the first table and > insert into the new table (insert into / select). > From davidmcafee at gmail.com Fri Aug 21 11:55:09 2015 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 21 Aug 2015 09:55:09 -0700 Subject: [AccessD] Outlook 365 Search doesn't find old emails Message-ID: We've recently switched to Office 365 (well at least with Outlook at this point). The transition has been problem free other than the fact that when I use the "search all mail items" box at the top in Outlook, it doesn't find anything in my old/non 365 emails. The mail is there, I can see it and scroll down and find it manually. I've also noticed that if I right click on someone's name and choose "Find all -> Messages from sender", only the new stuff shows up. Does anyone know of a fix for this? Thanks, David From mwp.reid at qub.ac.uk Fri Aug 21 12:12:21 2015 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Fri, 21 Aug 2015 17:12:21 +0000 Subject: [AccessD] Outlook 365 Search doesn't find old emails In-Reply-To: References: Message-ID: <976E500DD0AF35409874A413967BFAEC482D00A2@EX2K10-MBX5.ads.qub.ac.uk> Does this help http://superuser.com/questions/724096/outlook-2013-not-showing-emails-older-than-aprox-6months-old-in-any-folders ________________________________ From: David McAfee Sent: ?21/?08/?2015 17:56 To: Access Developers discussion and problem solving Subject: [AccessD] Outlook 365 Search doesn't find old emails We've recently switched to Office 365 (well at least with Outlook at this point). The transition has been problem free other than the fact that when I use the "search all mail items" box at the top in Outlook, it doesn't find anything in my old/non 365 emails. The mail is there, I can see it and scroll down and find it manually. I've also noticed that if I right click on someone's name and choose "Find all -> Messages from sender", only the new stuff shows up. Does anyone know of a fix for this? Thanks, David -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Fri Aug 21 12:56:27 2015 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 21 Aug 2015 10:56:27 -0700 Subject: [AccessD] Outlook 365 Search doesn't find old emails In-Reply-To: <976E500DD0AF35409874A413967BFAEC482D00A2@EX2K10-MBX5.ads.qub.ac.uk> References: <976E500DD0AF35409874A413967BFAEC482D00A2@EX2K10-MBX5.ads.qub.ac.uk> Message-ID: No. I can see the emails, just not find them via Search (or find related). I am using Outlook 2007. I think we are all moving to Office2013, but not sure when. On Fri, Aug 21, 2015 at 10:12 AM, Martin Reid wrote: > Does this help > > > http://superuser.com/questions/724096/outlook-2013-not-showing-emails-older-than-aprox-6months-old-in-any-folders > ________________________________ > From: David McAfee > Sent: ?21/?08/?2015 17:56 > To: Access Developers discussion and problem solving accessd at databaseadvisors.com> > Subject: [AccessD] Outlook 365 Search doesn't find old emails > > We've recently switched to Office 365 (well at least with Outlook at this > point). > > The transition has been problem free other than the fact that when I use > the > "search all mail items" box at the top in Outlook, it doesn't find anything > in my > old/non 365 emails. The mail is there, I can see it and scroll down and > find it manually. > > I've also noticed that if I right click on someone's name and choose "Find > all -> Messages from sender", only the new stuff shows up. > > Does anyone know of a fix for this? > > Thanks, > David > -- > 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 Fri Aug 21 14:52:46 2015 From: jimdettman at verizon.net (Jim Dettman) Date: Fri, 21 Aug 2015 15:52:46 -0400 Subject: [AccessD] Folks.... Message-ID: <9D6A4D83C7B5477FAAADF8907549D1F8@XPS> Folks Please make sure anything that is not Access specific is at the very least tagged OT in the subject line. Also keep in mind that Database Advisers has other lists where posting a topic may be more appropriate (http://databaseadvisors.com/mailman/listinfo). And before anyone says anything, I didn't make the rules, so don't shoot the messenger. Thanks, Jim. From bensonforums at gmail.com Fri Aug 21 17:42:19 2015 From: bensonforums at gmail.com (Bill Benson) Date: Fri, 21 Aug 2015 18:42:19 -0400 Subject: [AccessD] Folks.... In-Reply-To: <9D6A4D83C7B5477FAAADF8907549D1F8@XPS> References: <9D6A4D83C7B5477FAAADF8907549D1F8@XPS> Message-ID: Haven't seen any threads recently in this capacity... except this one. Bill On Aug 21, 2015 3:51 PM, "Jim Dettman" wrote: > Folks > > Please make sure anything that is not Access specific is at the very least > tagged OT in the subject line. Also keep in mind that Database Advisers has > other lists where posting a topic may be more appropriate > (http://databaseadvisors.com/mailman/listinfo). > > And before anyone says anything, I didn't make the rules, so don't shoot > the > messenger. > > Thanks, > Jim. > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From accessd at shaw.ca Fri Aug 21 18:06:15 2015 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 21 Aug 2015 17:06:15 -0600 (MDT) Subject: [AccessD] Outlook 365 Search doesn't find old emails In-Reply-To: <976E500DD0AF35409874A413967BFAEC482D00A2@EX2K10-MBX5.ads.qub.ac.uk> Message-ID: <965926065.30371388.1440198375654.JavaMail.root@shaw.ca> Those little flags are so important. Recently had someone said that they can not use GMail as it no longer shows their new emails...then they clicked on the Unread button. ;-) Jim ----- Original Message ----- From: "Martin Reid" To: "Access Developers discussion and problem solving" Sent: Friday, August 21, 2015 10:12:21 AM Subject: Re: [AccessD] Outlook 365 Search doesn't find old emails Does this help http://superuser.com/questions/724096/outlook-2013-not-showing-emails-older-than-aprox-6months-old-in-any-folders ________________________________ From: David McAfee Sent: ?21/?08/?2015 17:56 To: Access Developers discussion and problem solving Subject: [AccessD] Outlook 365 Search doesn't find old emails We've recently switched to Office 365 (well at least with Outlook at this point). The transition has been problem free other than the fact that when I use the "search all mail items" box at the top in Outlook, it doesn't find anything in my old/non 365 emails. The mail is there, I can see it and scroll down and find it manually. I've also noticed that if I right click on someone's name and choose "Find all -> Messages from sender", only the new stuff shows up. Does anyone know of a fix for this? Thanks, David -- 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 Aug 26 09:37:46 2015 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 26 Aug 2015 10:37:46 -0400 Subject: [AccessD] Problem implementing checkbox control class module Message-ID: At form load, I am running the below routine. Myck is dimensioned at the form module level. I don't even think it shold matter whether I do that or dim it at the procedure level, but it has been making no difference. The click event in my class module where I have dimmed ck publicly withevents is not firing. I am using a collection to hold the Myck.ck; I would think keeping that in memory by scoping it to the form module is enough - but even declaring it publicly has not helped me synch the class module with the control being clicked. Help? 'Standard Module Public gColcolCk As Collection 'Form Module Dim Myck As clsck Private Sub LoadReportTabs() Set gColcolCk = New Collection Set Myck = New clsck Set Myck.ck = ckUseThis gColcolCk.Add Myck End Sub 'Class clsCk Option Compare Database Option Explicit Public WithEvents ck As CheckBox Private Sub Ck_Click() msgbox "Clicked" End Sub From bensonforums at gmail.com Wed Aug 26 09:57:56 2015 From: bensonforums at gmail.com (Bill Benson) Date: Wed, 26 Aug 2015 10:57:56 -0400 Subject: [AccessD] Problem implementing checkbox control class module In-Reply-To: References: Message-ID: SOLVED... needed to assign Event Procedure to the OnClick property [hate that]... Private Sub LoadReportTabs() Set gColcolCk = New Collection Set Myck = New clsck Set Myck.ck = ckUseThis Myck.ck.OnClick = "[Event Procedure]" gColcolCk.Add Myck On Wed, Aug 26, 2015 at 10:37 AM, Bill Benson wrote: > At form load, I am running the below routine. > > Myck is dimensioned at the form module level. I don't even think it shold > matter whether I do that or dim it at the procedure level, but it has been > making no difference. > > The click event in my class module where I have dimmed ck publicly > withevents is not firing. > > I am using a collection to hold the Myck.ck; I would think keeping that in > memory by scoping it to the form module is enough - but even declaring it > publicly has not helped me synch the class module with the control being > clicked. > > Help? > > 'Standard Module > Public gColcolCk As Collection > 'Form Module > Dim Myck As clsck > > Private Sub LoadReportTabs() > Set gColcolCk = New Collection > Set Myck = New clsck > Set Myck.ck = ckUseThis > gColcolCk.Add Myck > End Sub > 'Class clsCk > Option Compare Database > Option Explicit > Public WithEvents ck As CheckBox > Private Sub Ck_Click() > msgbox "Clicked" > End Sub > From gustav at cactus.dk Fri Aug 28 10:29:44 2015 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 28 Aug 2015 15:29:44 +0000 Subject: [AccessD] Create a random date/time Message-ID: Hi all Have you ever wondered how to create a random date/time? Well I hadn't, but it is not that difficult. The trick is using Rnd twice: RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * Rnd * Rnd + CLng(#1/1/100#)) The full story is here: http://stackoverflow.com/a/32265346/3527297 If you want a value within a given range, you can use this simple function: Public Function DateRandom( _ Optional ByVal UpperDate As Date = #12/31/9999#, _ Optional ByVal LowerDate As Date = #1/1/100#) _ As Date ' Generates a random date/time - optionally within the range of LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus Data ApS, CPH. Dim RandomDate As Date RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd + CLng(LowerDate)) DateRandom = RandomDate End Function /gustav From accessd at shaw.ca Fri Aug 28 11:42:56 2015 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 28 Aug 2015 10:42:56 -0600 (MDT) Subject: [AccessD] Create a random date/time In-Reply-To: Message-ID: <1382601605.3616423.1440780176623.JavaMail.root@shaw.ca> Hi Gustav: That definitely could be useful for some many types of problems. Jim ----- Original Message ----- From: "Gustav Brock" To: "Access Developers discussion and problem solving" Sent: Friday, August 28, 2015 8:29:44 AM Subject: [AccessD] Create a random date/time Hi all Have you ever wondered how to create a random date/time? Well I hadn't, but it is not that difficult. The trick is using Rnd twice: RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * Rnd * Rnd + CLng(#1/1/100#)) The full story is here: http://stackoverflow.com/a/32265346/3527297 If you want a value within a given range, you can use this simple function: Public Function DateRandom( _ Optional ByVal UpperDate As Date = #12/31/9999#, _ Optional ByVal LowerDate As Date = #1/1/100#) _ As Date ' Generates a random date/time - optionally within the range of LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus Data ApS, CPH. Dim RandomDate As Date RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd + CLng(LowerDate)) DateRandom = RandomDate End Function /gustav -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shait at stephenhait.com Fri Aug 28 16:02:20 2015 From: shait at stephenhait.com (Stephen Hait) Date: Fri, 28 Aug 2015 17:02:20 -0400 Subject: [AccessD] How to search the archive? Message-ID: Where could I search the list archive for questions that likely have been answered numerous times? Thanks, Stephen From jamesbutton at blueyonder.co.uk Fri Aug 28 16:27:07 2015 From: jamesbutton at blueyonder.co.uk (James Button) Date: Fri, 28 Aug 2015 22:27:07 +0100 Subject: [AccessD] How to search the archive? In-Reply-To: References: Message-ID: Try http://databaseadvisors.com/pipermail/accessd/ JimB -----Original Message----- From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stephen Hait Sent: Friday, August 28, 2015 10:02 PM To: Access Developers discussion and problem solving Subject: [AccessD] How to search the archive? Where could I search the list archive for questions that likely have been answered numerous times? Thanks, Stephen -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From carbonnb at gmail.com Fri Aug 28 16:32:37 2015 From: carbonnb at gmail.com (Bryan Carbonnell) Date: Fri, 28 Aug 2015 17:32:37 -0400 Subject: [AccessD] How to search the archive? In-Reply-To: References: Message-ID: The search for the archives is not working. Your best bet to search is to goto google and enter your search terms, then add inurl:http://databaseadvisors.com/pipermail/accessd/ to the end and search. So in the search box you would enter: Search terms inurl:http://databaseadvisors.com/pipermail/accessd/ Bryan On Fri, Aug 28, 2015 at 5:02 PM, Stephen Hait wrote: > Where could I search the list archive for questions that likely have been > answered numerous times? > > Thanks, > Stephen > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From shait at stephenhait.com Fri Aug 28 17:17:41 2015 From: shait at stephenhait.com (Stephen Hait) Date: Fri, 28 Aug 2015 18:17:41 -0400 Subject: [AccessD] How to search the archive? In-Reply-To: References: Message-ID: On Fri, Aug 28, 2015 at 5:32 PM, Bryan Carbonnell wrote: > The search for the archives is not working. Your best bet to search is > to goto google and enter your search terms, then add > inurl:http://databaseadvisors.com/pipermail/accessd/ to the end and > search. > > So in the search box you would enter: > Search terms inurl:http://databaseadvisors.com/pipermail/accessd/ Thanks - good tip. I'm specifically looking for ways to limit issues when two or more users are modifiying the same row in a table while using an unbound form. Are there any suggestions for best practices on this? Thanks in advance for any insights. Stephen From stuart at lexacorp.com.pg Fri Aug 28 20:21:50 2015 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 29 Aug 2015 11:21:50 +1000 Subject: [AccessD] Create a random date/time In-Reply-To: References: Message-ID: <55E1092E.7913.18817E34@stuart.lexacorp.com.pg> Rnd * Rnd is NOT a "trick to create a random date/time". It is a trick to create "more significant digits" than the Single returned by a Rnd. Unfortunately it has a VERY bad side effect. Multiplying random numbers together alters the probablility distribution. http://mathworld.wolfram.com/UniformProductDistribution.html A better way would be to use Rnd twice in a different way. First to generate the Date part and a second time to generate the time part, then add then together. -- Stuart On 28 Aug 2015 at 15:29, Gustav Brock wrote: > Hi all > > Have you ever wondered how to create a random date/time? > > Well I hadn't, but it is not that difficult. The trick is using Rnd > twice: > > RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * Rnd * > Rnd + CLng(#1/1/100#)) > > The full story is here: > > http://stackoverflow.com/a/32265346/3527297 > > If you want a value within a given range, you can use this simple > function: > > > Public Function DateRandom( _ > Optional ByVal UpperDate As Date = #12/31/9999#, _ > Optional ByVal LowerDate As Date = #1/1/100#) _ > As Date > > ' Generates a random date/time - optionally within the range of > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > Data ApS, CPH. > > Dim RandomDate As Date > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd > + CLng(LowerDate)) > > DateRandom = RandomDate > > End Function > > > /gustav > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Sat Aug 29 13:10:22 2015 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 29 Aug 2015 18:10:22 +0000 Subject: [AccessD] Create a random date/time In-Reply-To: <55E1092E.7913.18817E34@stuart.lexacorp.com.pg> References: , <55E1092E.7913.18817E34@stuart.lexacorp.com.pg> Message-ID: Hi Stuart Thanks for the link - you are absolutely right - why didn't I think about this? While I believe - for the purpose - one could live with this limitation, the modification needed is really really simple: Initial method: RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd + CLng(LowerDate)) Modified as to your suggestion: RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + Rnd + CLng(LowerDate)) This is possible because Rnd returns values >= 0 and < 1, exactly matching the numeric value range of Time. The corrected function: Public Function DateRandom( _ Optional ByVal UpperDate As Date = #12/31/9999#, _ Optional ByVal LowerDate As Date = #1/1/100#) _ As Date ' Generates a random date/time - optionally within the range of LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus Data ApS, CPH. ' 2015-08-29. Modified for uniform distribution as suggested by Stuart McLachlan by ' combining a random date and a random time. Dim RandomDate As Date ' Random date: (CLng(UpperDate) - CLng(LowerDate)) * Rnd + CLng(LowerDate) ' Random time: Rnd RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + CLng(LowerDate) + Rnd) DateRandom = RandomDate End Function /gustav ________________________________________ Fra: AccessD p? vegne af Stuart McLachlan Sendt: 29. august 2015 03:21 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Create a random date/time Rnd * Rnd is NOT a "trick to create a random date/time". It is a trick to create "more significant digits" than the Single returned by a Rnd. Unfortunately it has a VERY bad side effect. Multiplying random numbers together alters the probablility distribution. http://mathworld.wolfram.com/UniformProductDistribution.html A better way would be to use Rnd twice in a different way. First to generate the Date part and a second time to generate the time part, then add then together. -- Stuart On 28 Aug 2015 at 15:29, Gustav Brock wrote: > Hi all > > Have you ever wondered how to create a random date/time? > > Well I hadn't, but it is not that difficult. The trick is using Rnd > twice: > > RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * Rnd * > Rnd + CLng(#1/1/100#)) > > The full story is here: > > http://stackoverflow.com/a/32265346/3527297 > > If you want a value within a given range, you can use this simple > function: > > > Public Function DateRandom( _ > Optional ByVal UpperDate As Date = #12/31/9999#, _ > Optional ByVal LowerDate As Date = #1/1/100#) _ > As Date > > ' Generates a random date/time - optionally within the range of > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > Data ApS, CPH. > > Dim RandomDate As Date > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd > + CLng(LowerDate)) > > DateRandom = RandomDate > > End Function > > > /gustav From bensonforums at gmail.com Sat Aug 29 13:55:58 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 29 Aug 2015 14:55:58 -0400 Subject: [AccessD] Create a random date/time In-Reply-To: References: <55E1092E.7913.18817E34@stuart.lexacorp.com.pg> Message-ID: There is a flaw in that function. Consider this for the current date Sub testformula() Dim dt As Date Dim i As Long Dim dttemp As Date dt = Date Dim dtMax As Date Dim dtMin As Date dtMin = CDate("1/1/2100") dtMax = CDate("1/1/1900") For i = 1 To 1000000# dttemp = CDate((CLng(dt) - CLng(dt)) * Rnd + CLng(dt) + Rnd) If dttemp > dtMax Then dtMax = dttemp If dttemp < dtMin Then dtMin = dttemp Next Debug.Print dtMin, dtMax End Sub I got an answer of 8/29/2015 8/30/2015 On Sat, Aug 29, 2015 at 2:10 PM, Gustav Brock wrote: > Hi Stuart > > Thanks for the link - you are absolutely right - why didn't I think about > this? > While I believe - for the purpose - one could live with this limitation, > the modification needed is really really simple: > > Initial method: > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd + > CLng(LowerDate)) > > Modified as to your suggestion: > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + Rnd + > CLng(LowerDate)) > > This is possible because Rnd returns values >= 0 and < 1, exactly matching > the numeric value range of Time. > > The corrected function: > > > Public Function DateRandom( _ > Optional ByVal UpperDate As Date = #12/31/9999#, _ > Optional ByVal LowerDate As Date = #1/1/100#) _ > As Date > > ' Generates a random date/time - optionally within the range of > LowerDate and/or UpperDate. > ' > ' 2015-08-28. Gustav Brock, Cactus Data ApS, CPH. > ' 2015-08-29. Modified for uniform distribution as suggested by Stuart > McLachlan by > ' combining a random date and a random time. > > Dim RandomDate As Date > > ' Random date: (CLng(UpperDate) - CLng(LowerDate)) * Rnd + > CLng(LowerDate) > ' Random time: Rnd > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > CLng(LowerDate) + Rnd) > > DateRandom = RandomDate > > End Function > > > /gustav > > ________________________________________ > Fra: AccessD p? vegne af Stuart > McLachlan > Sendt: 29. august 2015 03:21 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Create a random date/time > > Rnd * Rnd is NOT a "trick to create a random date/time". > > It is a trick to create "more significant digits" than the Single returned > by a Rnd. > > Unfortunately it has a VERY bad side effect. Multiplying random numbers > together alters the > probablility distribution. > http://mathworld.wolfram.com/UniformProductDistribution.html > > A better way would be to use Rnd twice in a different way. First to > generate the Date part and > a second time to generate the time part, then add then together. > > -- > Stuart > > On 28 Aug 2015 at 15:29, Gustav Brock wrote: > > > Hi all > > > > Have you ever wondered how to create a random date/time? > > > > Well I hadn't, but it is not that difficult. The trick is using Rnd > > twice: > > > > RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * Rnd * > > Rnd + CLng(#1/1/100#)) > > > > The full story is here: > > > > http://stackoverflow.com/a/32265346/3527297 > > > > If you want a value within a given range, you can use this simple > > function: > > > > > > Public Function DateRandom( _ > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > As Date > > > > ' Generates a random date/time - optionally within the range of > > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > > Data ApS, CPH. > > > > Dim RandomDate As Date > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd > > + CLng(LowerDate)) > > > > DateRandom = RandomDate > > > > End Function > > > > > > /gustav > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Sat Aug 29 18:39:33 2015 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 30 Aug 2015 09:39:33 +1000 Subject: [AccessD] Create a random date/time In-Reply-To: References: , , Message-ID: <55E242B5.10319.1D4A379C@stuart.lexacorp.com.pg> On 29 Aug 2015 at 14:55, Bill Benson wrote: > There is a flaw in that function. Consider this for the current date > > Sub testformula() > Dim dt As Date > Dim i As Long > Dim dttemp As Date > dt = Date > Dim dtMax As Date > Dim dtMin As Date > dtMin = CDate("1/1/2100") > dtMax = CDate("1/1/1900") > For i = 1 To 1000000# > dttemp = CDate((CLng(dt) - CLng(dt)) * Rnd + CLng(dt) + Rnd) > If dttemp > dtMax Then dtMax = dttemp > If dttemp < dtMin Then dtMin = dttemp > Next > Debug.Print dtMin, dtMax > End Sub > > I got an answer of > > 8/29/2015 8/30/2015 > > > On Sat, Aug 29, 2015 at 2:10 PM, Gustav Brock > wrote: > > > Hi Stuart > > > > Thanks for the link - you are absolutely right - why didn't I think > > about this? While I believe - for the purpose - one could live with > > this limitation, the modification needed is really really simple: > > > > Initial method: > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * > > Rnd + > > CLng(LowerDate)) > > > > Modified as to your suggestion: > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > Rnd + > > CLng(LowerDate)) > > > > This is possible because Rnd returns values >= 0 and < 1, exactly > > matching the numeric value range of Time. > > > > The corrected function: > > > > > > Public Function DateRandom( _ > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > As Date > > > > ' Generates a random date/time - optionally within the range of > > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > > Data ApS, CPH. ' 2015-08-29. Modified for uniform distribution as > > suggested by Stuart McLachlan by ' combining a random > > date and a random time. > > > > Dim RandomDate As Date > > > > ' Random date: (CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > CLng(LowerDate) > > ' Random time: Rnd > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > CLng(LowerDate) + Rnd) > > > > DateRandom = RandomDate > > > > End Function > > > > > > /gustav > > > > ________________________________________ > > Fra: AccessD p? vegne af > > Stuart McLachlan Sendt: 29. august 2015 > > 03:21 Til: Access Developers discussion and problem solving Emne: > > Re: [AccessD] Create a random date/time > > > > Rnd * Rnd is NOT a "trick to create a random date/time". > > > > It is a trick to create "more significant digits" than the Single > > returned by a Rnd. > > > > Unfortunately it has a VERY bad side effect. Multiplying random > > numbers together alters the probablility distribution. > > http://mathworld.wolfram.com/UniformProductDistribution.html > > > > A better way would be to use Rnd twice in a different way. First to > > generate the Date part and a second time to generate the time part, > > then add then together. > > > > -- > > Stuart > > > > On 28 Aug 2015 at 15:29, Gustav Brock wrote: > > > > > Hi all > > > > > > Have you ever wondered how to create a random date/time? > > > > > > Well I hadn't, but it is not that difficult. The trick is using > > > Rnd twice: > > > > > > RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * > > > Rnd * Rnd + CLng(#1/1/100#)) > > > > > > The full story is here: > > > > > > http://stackoverflow.com/a/32265346/3527297 > > > > > > If you want a value within a given range, you can use this simple > > > function: > > > > > > > > > Public Function DateRandom( _ > > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > > As Date > > > > > > ' Generates a random date/time - optionally within the range of > > > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > > > Data ApS, CPH. > > > > > > Dim RandomDate As Date > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * > > > Rnd > > > + CLng(LowerDate)) > > > > > > DateRandom = RandomDate > > > > > > End Function > > > > > > > > > /gustav > > -- > > 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 Sat Aug 29 18:39:33 2015 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 30 Aug 2015 09:39:33 +1000 Subject: [AccessD] Create a random date/time In-Reply-To: References: , , Message-ID: <55E242B5.9197.1D4A38A6@stuart.lexacorp.com.pg> No, it's doing what you are asking it to since you are using the same dt=Date for the bounds. Try this: Sub testformula() Dim dt As Date Dim i As Long Dim dttemp As Date Dim DtHi As Date Dim dtLo As Date DtHi = CDate("1/1/2015") dtLo = CDate("31/12/2015") Dim dtMax As Date Dim dtMin As Date dtMin = CDate("1/1/2100") dtMax = CDate("1/1/1900") For i = 1 To 1000000# dttemp = CDate((CLng(DtHi) - CLng(dtLo)) * Rnd + CLng(dtLo) + Rnd) If dttemp > dtMax Then dtMax = dttemp If dttemp < dtMin Then dtMin = dttemp Next Debug.Print dtMin, dtMax End Sub On 29 Aug 2015 at 14:55, Bill Benson wrote: > There is a flaw in that function. Consider this for the current date > > Sub testformula() > Dim dt As Date > Dim i As Long > Dim dttemp As Date > dt = Date > Dim dtMax As Date > Dim dtMin As Date > dtMin = CDate("1/1/2100") > dtMax = CDate("1/1/1900") > For i = 1 To 1000000# > dttemp = CDate((CLng(dt) - CLng(dt)) * Rnd + CLng(dt) + Rnd) > If dttemp > dtMax Then dtMax = dttemp > If dttemp < dtMin Then dtMin = dttemp > Next > Debug.Print dtMin, dtMax > End Sub > > I got an answer of > > 8/29/2015 8/30/2015 > > > On Sat, Aug 29, 2015 at 2:10 PM, Gustav Brock > wrote: > > > Hi Stuart > > > > Thanks for the link - you are absolutely right - why didn't I think > > about this? While I believe - for the purpose - one could live with > > this limitation, the modification needed is really really simple: > > > > Initial method: > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * > > Rnd + > > CLng(LowerDate)) > > > > Modified as to your suggestion: > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > Rnd + > > CLng(LowerDate)) > > > > This is possible because Rnd returns values >= 0 and < 1, exactly > > matching the numeric value range of Time. > > > > The corrected function: > > > > > > Public Function DateRandom( _ > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > As Date > > > > ' Generates a random date/time - optionally within the range of > > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > > Data ApS, CPH. ' 2015-08-29. Modified for uniform distribution as > > suggested by Stuart McLachlan by ' combining a random > > date and a random time. > > > > Dim RandomDate As Date > > > > ' Random date: (CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > CLng(LowerDate) > > ' Random time: Rnd > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > CLng(LowerDate) + Rnd) > > > > DateRandom = RandomDate > > > > End Function > > > > > > /gustav > > > > ________________________________________ > > Fra: AccessD p? vegne af > > Stuart McLachlan Sendt: 29. august 2015 > > 03:21 Til: Access Developers discussion and problem solving Emne: > > Re: [AccessD] Create a random date/time > > > > Rnd * Rnd is NOT a "trick to create a random date/time". > > > > It is a trick to create "more significant digits" than the Single > > returned by a Rnd. > > > > Unfortunately it has a VERY bad side effect. Multiplying random > > numbers together alters the probablility distribution. > > http://mathworld.wolfram.com/UniformProductDistribution.html > > > > A better way would be to use Rnd twice in a different way. First to > > generate the Date part and a second time to generate the time part, > > then add then together. > > > > -- > > Stuart > > > > On 28 Aug 2015 at 15:29, Gustav Brock wrote: > > > > > Hi all > > > > > > Have you ever wondered how to create a random date/time? > > > > > > Well I hadn't, but it is not that difficult. The trick is using > > > Rnd twice: > > > > > > RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * > > > Rnd * Rnd + CLng(#1/1/100#)) > > > > > > The full story is here: > > > > > > http://stackoverflow.com/a/32265346/3527297 > > > > > > If you want a value within a given range, you can use this simple > > > function: > > > > > > > > > Public Function DateRandom( _ > > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > > As Date > > > > > > ' Generates a random date/time - optionally within the range of > > > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > > > Data ApS, CPH. > > > > > > Dim RandomDate As Date > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * > > > Rnd > > > + CLng(LowerDate)) > > > > > > DateRandom = RandomDate > > > > > > End Function > > > > > > > > > /gustav > > -- > > 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 Sat Aug 29 18:42:18 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 29 Aug 2015 19:42:18 -0400 Subject: [AccessD] Create a random date/time In-Reply-To: <55E242B5.9197.1D4A38A6@stuart.lexacorp.com.pg> References: <55E242B5.9197.1D4A38A6@stuart.lexacorp.com.pg> Message-ID: I disagree. If I ask for a random date between today and today you had better not give me tomorrow. Confused how this can even be confusing! On Aug 29, 2015 7:41 PM, "Stuart McLachlan" wrote: > No, it's doing what you are asking it to since you are using the same > dt=Date for the bounds. > > Try this: > > Sub testformula() > Dim dt As Date > Dim i As Long > Dim dttemp As Date > Dim DtHi As Date > Dim dtLo As Date > DtHi = CDate("1/1/2015") > dtLo = CDate("31/12/2015") > Dim dtMax As Date > Dim dtMin As Date > dtMin = CDate("1/1/2100") > dtMax = CDate("1/1/1900") > For i = 1 To 1000000# > dttemp = CDate((CLng(DtHi) - CLng(dtLo)) * Rnd + CLng(dtLo) + Rnd) > If dttemp > dtMax Then dtMax = dttemp > If dttemp < dtMin Then dtMin = dttemp > Next > Debug.Print dtMin, dtMax > End Sub > > > > On 29 Aug 2015 at 14:55, Bill Benson wrote: > > > There is a flaw in that function. Consider this for the current date > > > > Sub testformula() > > Dim dt As Date > > Dim i As Long > > Dim dttemp As Date > > dt = Date > > Dim dtMax As Date > > Dim dtMin As Date > > dtMin = CDate("1/1/2100") > > dtMax = CDate("1/1/1900") > > For i = 1 To 1000000# > > dttemp = CDate((CLng(dt) - CLng(dt)) * Rnd + CLng(dt) + Rnd) > > If dttemp > dtMax Then dtMax = dttemp > > If dttemp < dtMin Then dtMin = dttemp > > Next > > Debug.Print dtMin, dtMax > > End Sub > > > > I got an answer of > > > > 8/29/2015 8/30/2015 > > > > > > On Sat, Aug 29, 2015 at 2:10 PM, Gustav Brock > > wrote: > > > > > Hi Stuart > > > > > > Thanks for the link - you are absolutely right - why didn't I think > > > about this? While I believe - for the purpose - one could live with > > > this limitation, the modification needed is really really simple: > > > > > > Initial method: > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * > > > Rnd + > > > CLng(LowerDate)) > > > > > > Modified as to your suggestion: > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > > Rnd + > > > CLng(LowerDate)) > > > > > > This is possible because Rnd returns values >= 0 and < 1, exactly > > > matching the numeric value range of Time. > > > > > > The corrected function: > > > > > > > > > Public Function DateRandom( _ > > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > > As Date > > > > > > ' Generates a random date/time - optionally within the range of > > > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > > > Data ApS, CPH. ' 2015-08-29. Modified for uniform distribution as > > > suggested by Stuart McLachlan by ' combining a random > > > date and a random time. > > > > > > Dim RandomDate As Date > > > > > > ' Random date: (CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > > CLng(LowerDate) > > > ' Random time: Rnd > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > > CLng(LowerDate) + Rnd) > > > > > > DateRandom = RandomDate > > > > > > End Function > > > > > > > > > /gustav > > > > > > ________________________________________ > > > Fra: AccessD p? vegne af > > > Stuart McLachlan Sendt: 29. august 2015 > > > 03:21 Til: Access Developers discussion and problem solving Emne: > > > Re: [AccessD] Create a random date/time > > > > > > Rnd * Rnd is NOT a "trick to create a random date/time". > > > > > > It is a trick to create "more significant digits" than the Single > > > returned by a Rnd. > > > > > > Unfortunately it has a VERY bad side effect. Multiplying random > > > numbers together alters the probablility distribution. > > > http://mathworld.wolfram.com/UniformProductDistribution.html > > > > > > A better way would be to use Rnd twice in a different way. First to > > > generate the Date part and a second time to generate the time part, > > > then add then together. > > > > > > -- > > > Stuart > > > > > > On 28 Aug 2015 at 15:29, Gustav Brock wrote: > > > > > > > Hi all > > > > > > > > Have you ever wondered how to create a random date/time? > > > > > > > > Well I hadn't, but it is not that difficult. The trick is using > > > > Rnd twice: > > > > > > > > RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) * > > > > Rnd * Rnd + CLng(#1/1/100#)) > > > > > > > > The full story is here: > > > > > > > > http://stackoverflow.com/a/32265346/3527297 > > > > > > > > If you want a value within a given range, you can use this simple > > > > function: > > > > > > > > > > > > Public Function DateRandom( _ > > > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > > > As Date > > > > > > > > ' Generates a random date/time - optionally within the range of > > > > LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, Cactus > > > > Data ApS, CPH. > > > > > > > > Dim RandomDate As Date > > > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * > > > > Rnd > > > > + CLng(LowerDate)) > > > > > > > > DateRandom = RandomDate > > > > > > > > End Function > > > > > > > > > > > > /gustav > > > -- > > > 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 Sat Aug 29 19:13:13 2015 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 30 Aug 2015 10:13:13 +1000 Subject: [AccessD] Create a random date/time In-Reply-To: References: , <55E242B5.9197.1D4A38A6@stuart.lexacorp.com.pg>, Message-ID: <55E24A99.1281.1D6908FF@stuart.lexacorp.com.pg> Not really a flaw, you are coming up against a rounding error. Since there are only 86,400 seconds in a day, In 1,000,000 random numbers you are going to get a few which round up to 1 when converted to a DateTime and displayed to the nearest second (the default). On average, you will get the next day once in every 172,800 iterations if you just want times in a single date. That number is multiplied by the number of days in your range, so if you want a random date within 365 days, it will only happen once on average in 63 million iterations. Do you still get the same problem if you use ? Format(dtMax,"d mmm yyy hh:nn:ss:ms") -- Stuart On 29 Aug 2015 at 19:42, Bill Benson wrote: > I disagree. > > If I ask for a random date between today and today you had better not > give me tomorrow. > > Confused how this can even be confusing! > On Aug 29, 2015 7:41 PM, "Stuart McLachlan" > wrote: > > > No, it's doing what you are asking it to since you are using the > > same dt=Date for the bounds. > > > > Try this: > > > > Sub testformula() > > Dim dt As Date > > Dim i As Long > > Dim dttemp As Date > > Dim DtHi As Date > > Dim dtLo As Date > > DtHi = CDate("1/1/2015") > > dtLo = CDate("31/12/2015") > > Dim dtMax As Date > > Dim dtMin As Date > > dtMin = CDate("1/1/2100") > > dtMax = CDate("1/1/1900") > > For i = 1 To 1000000# > > dttemp = CDate((CLng(DtHi) - CLng(dtLo)) * Rnd + CLng(dtLo) + > > Rnd) If dttemp > dtMax Then dtMax = dttemp If dttemp < dtMin > > Then dtMin = dttemp > > Next > > Debug.Print dtMin, dtMax > > End Sub > > > > > > > > On 29 Aug 2015 at 14:55, Bill Benson wrote: > > > > > There is a flaw in that function. Consider this for the current > > > date > > > > > > Sub testformula() > > > Dim dt As Date > > > Dim i As Long > > > Dim dttemp As Date > > > dt = Date > > > Dim dtMax As Date > > > Dim dtMin As Date > > > dtMin = CDate("1/1/2100") > > > dtMax = CDate("1/1/1900") > > > For i = 1 To 1000000# > > > dttemp = CDate((CLng(dt) - CLng(dt)) * Rnd + CLng(dt) + Rnd) > > > If dttemp > dtMax Then dtMax = dttemp If dttemp < dtMin Then > > > dtMin = dttemp > > > Next > > > Debug.Print dtMin, dtMax > > > End Sub > > > > > > I got an answer of > > > > > > 8/29/2015 8/30/2015 > > > > > > > > > On Sat, Aug 29, 2015 at 2:10 PM, Gustav Brock > > > wrote: > > > > > > > Hi Stuart > > > > > > > > Thanks for the link - you are absolutely right - why didn't I > > > > think about this? While I believe - for the purpose - one could > > > > live with this limitation, the modification needed is really > > > > really simple: > > > > > > > > Initial method: > > > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd > > > > * Rnd + > > > > CLng(LowerDate)) > > > > > > > > Modified as to your suggestion: > > > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd > > > > + Rnd + > > > > CLng(LowerDate)) > > > > > > > > This is possible because Rnd returns values >= 0 and < 1, > > > > exactly matching the numeric value range of Time. > > > > > > > > The corrected function: > > > > > > > > > > > > Public Function DateRandom( _ > > > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > > > As Date > > > > > > > > ' Generates a random date/time - optionally within the range > > > > of LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, > > > > Cactus Data ApS, CPH. ' 2015-08-29. Modified for uniform > > > > distribution as suggested by Stuart McLachlan by ' > > > > combining a random date and a random time. > > > > > > > > Dim RandomDate As Date > > > > > > > > ' Random date: (CLng(UpperDate) - CLng(LowerDate)) * Rnd + > > > > CLng(LowerDate) > > > > ' Random time: Rnd > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd > > > > + > > > > CLng(LowerDate) + Rnd) > > > > > > > > DateRandom = RandomDate > > > > > > > > End Function > > > > > > > > > > > > /gustav > > > > > > > > ________________________________________ > > > > Fra: AccessD p? vegne af > > > > Stuart McLachlan Sendt: 29. august 2015 > > > > 03:21 Til: Access Developers discussion and problem solving > > > > Emne: Re: [AccessD] Create a random date/time > > > > > > > > Rnd * Rnd is NOT a "trick to create a random date/time". > > > > > > > > It is a trick to create "more significant digits" than the > > > > Single returned by a Rnd. > > > > > > > > Unfortunately it has a VERY bad side effect. Multiplying random > > > > numbers together alters the probablility distribution. > > > > http://mathworld.wolfram.com/UniformProductDistribution.html > > > > > > > > A better way would be to use Rnd twice in a different way. First > > > > to generate the Date part and a second time to generate the time > > > > part, then add then together. > > > > > > > > -- > > > > Stuart > > > > > > > > On 28 Aug 2015 at 15:29, Gustav Brock wrote: > > > > > > > > > Hi all > > > > > > > > > > Have you ever wondered how to create a random date/time? > > > > > > > > > > Well I hadn't, but it is not that difficult. The trick is > > > > > using Rnd twice: > > > > > > > > > > RandomDate = CDate((CLng(#12/31/9999#) - CLng(#1/1/100#)) > > > > > * Rnd * Rnd + CLng(#1/1/100#)) > > > > > > > > > > The full story is here: > > > > > > > > > > http://stackoverflow.com/a/32265346/3527297 > > > > > > > > > > If you want a value within a given range, you can use this > > > > > simple function: > > > > > > > > > > > > > > > Public Function DateRandom( _ > > > > > Optional ByVal UpperDate As Date = #12/31/9999#, _ > > > > > Optional ByVal LowerDate As Date = #1/1/100#) _ > > > > > As Date > > > > > > > > > > ' Generates a random date/time - optionally within the range > > > > > of LowerDate and/or UpperDate. ' ' 2015-08-28. Gustav Brock, > > > > > Cactus Data ApS, CPH. > > > > > > > > > > Dim RandomDate As Date > > > > > > > > > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * > > > > > Rnd * Rnd > > > > > + CLng(LowerDate)) > > > > > > > > > > DateRandom = RandomDate > > > > > > > > > > End Function > > > > > > > > > > > > > > > /gustav > > > > -- > > > > 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 bensonforums at gmail.com Sat Aug 29 19:19:35 2015 From: bensonforums at gmail.com (Bill Benson) Date: Sat, 29 Aug 2015 20:19:35 -0400 Subject: [AccessD] Create a random date/time In-Reply-To: References: <55E242B5.9197.1D4A38A6@stuart.lexacorp.com.pg> <55E24A99.1281.1D6908FF@stuart.lexacorp.com.pg> Message-ID: On Aug 29, 2015 8:18 PM, "Bill Benson" wrote: > > I don't have a dog in the fight here Stuart. > > I am not coming up against anything. > > If you don't want to treat the rounding error ramifications by limiting the results to the lb and ub dates, then you live with the results. > > That's all I was pointing out. > > I have no use for this function presently but thought I owed it to the thread participants, especially Gustav, to point out the clarification. > > Signing off! > > On Aug 29, 2015 8:14 PM, "Stuart McLachlan" wrote: >> >> Not really a flaw, you are coming up against a rounding error. >> >> Since there are only 86,400 seconds in a day, In 1,000,000 random numbers you are going >> to get a few which round up to 1 when converted to a DateTime and displayed to the nearest >> second (the default). On average, you will get the next day once in every 172,800 iterations >> if you just want times in a single date. That number is multiplied by the number of days in >> your range, so if you want a random date within 365 days, it will only happen once on >> average in 63 million iterations. >> >> Do you still get the same problem if you use ? Format(dtMax,"d mmm yyy hh:nn:ss:ms") >> >> -- >> Stuart >> >> From gustav at cactus.dk Sun Aug 30 04:26:03 2015 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 30 Aug 2015 09:26:03 +0000 Subject: [AccessD] Create a random date/time In-Reply-To: References: <55E1092E.7913.18817E34@stuart.lexacorp.com.pg> , Message-ID: Hi Bill You are correct. The reason is - as Stuart mentions - rounding or rather missing rounding. It's a good example of when you think you are smart you may be too smart. So I have expanded and modified my smart function to take care of the flaw. While at it, I've added the option to include or not the date, time, or millisecond part in the output: Public Function DateRandom( _ Optional ByVal UpperDate As Date = #12/31/9999#, _ Optional ByVal LowerDate As Date = #1/1/100#, _ Optional ByVal DatePart As Boolean = True, _ Optional ByVal TimePart As Boolean = True, _ Optional ByVal MilliSecondPart As Boolean = False) _ As Date ' Generates a random date/time - optionally within the range of LowerDate and/or UpperDate. ' Optionally, return value can be set to include date and/or time and/or milliseconds. ' ' 2015-08-28. Gustav Brock, Cactus Data ApS, CPH. ' 2015-08-29. Modified for uniform distribution as suggested by Stuart McLachlan by ' combining a random date and a random time. ' 2015-08-30 Modified to return selectable and rounded value parts for ' Date, Time, and Milliseconds. Const SecondsPerDay As Long = 60& * 60& * 24& Dim DateValue As Date Dim TimeValue As Date Dim MSecValue As Date ' If all parts are deselected, select date and time. If Not DatePart And Not TimePart And Not MilliSecondPart = True Then DatePart = True TimePart = True End If If DatePart = True Then ' Remove time parts from UpperDate and LowerDate as well from the result value. ' Add 1 to include LowerDate as a possible return value. DateValue = CDate(Int((Int(UpperDate) - Int(LowerDate) + 1) * Rnd) + Int(LowerDate)) End If If TimePart = True Then ' Calculate a time value rounded to the second. TimeValue = CDate(Int(SecondsPerDay * Rnd) / SecondsPerDay) End If If MilliSecondPart = True Then ' Calculate a millisecond value rounded to the millisecond. MSecValue = CDate(Int(1000 * Rnd) / 1000 / SecondsPerDay) End If DateRandom = DateValue + TimeValue + MSecValue End Function Note that Access will - for display - round milliseconds to the nearest second. That means that for example 23.59:59.777 rounds to 00:00:00 of the following day, thus you had a minimum and maximum date with a difference of one day. Adjusting your test function to use the modified DateRandom: Sub testformula() Dim dt As Date Dim i As Long Dim dttemp As Date dt = Date Dim dtMax As Date Dim dtMin As Date dtMin = CDate("1/1/2100") dtMax = CDate("1/1/1900") For i = 1 To 1000000# dttemp = DateRandom(dt, dt, , False) If dttemp > dtMax Then dtMax = dttemp If dttemp < dtMin Then dtMin = dttemp Next Debug.Print dtMin, dtMax End Sub it now returns: 2015-08-30 2015-08-30 and if TimePart is True: 2015-08-30 2015-08-30 23:59:59 /gustav ________________________________________ Fra: AccessD p? vegne af Bill Benson Sendt: 29. august 2015 20:55 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Create a random date/time There is a flaw in that function. Consider this for the current date Sub testformula() Dim dt As Date Dim i As Long Dim dttemp As Date dt = Date Dim dtMax As Date Dim dtMin As Date dtMin = CDate("1/1/2100") dtMax = CDate("1/1/1900") For i = 1 To 1000000# dttemp = CDate((CLng(dt) - CLng(dt)) * Rnd + CLng(dt) + Rnd) If dttemp > dtMax Then dtMax = dttemp If dttemp < dtMin Then dtMin = dttemp Next Debug.Print dtMin, dtMax End Sub I got an answer of 8/29/2015 8/30/2015 On Sat, Aug 29, 2015 at 2:10 PM, Gustav Brock wrote: > Hi Stuart > > Thanks for the link - you are absolutely right - why didn't I think about > this? > While I believe - for the purpose - one could live with this limitation, > the modification needed is really really simple: > > Initial method: > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd * Rnd + > CLng(LowerDate)) > > Modified as to your suggestion: > > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + Rnd + > CLng(LowerDate)) > > This is possible because Rnd returns values >= 0 and < 1, exactly matching > the numeric value range of Time. > > The corrected function: > > > Public Function DateRandom( _ > Optional ByVal UpperDate As Date = #12/31/9999#, _ > Optional ByVal LowerDate As Date = #1/1/100#) _ > As Date > > ' Generates a random date/time - optionally within the range of > LowerDate and/or UpperDate. > ' > ' 2015-08-28. Gustav Brock, Cactus Data ApS, CPH. > ' 2015-08-29. Modified for uniform distribution as suggested by Stuart > McLachlan by > ' combining a random date and a random time. > > Dim RandomDate As Date > > ' Random date: (CLng(UpperDate) - CLng(LowerDate)) * Rnd + > CLng(LowerDate) > ' Random time: Rnd > RandomDate = CDate((CLng(UpperDate) - CLng(LowerDate)) * Rnd + > CLng(LowerDate) + Rnd) > > DateRandom = RandomDate > > End Function > > > /gustav From fuller.artful at gmail.com Sun Aug 30 05:31:55 2015 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 30 Aug 2015 06:31:55 -0400 Subject: [AccessD] Create a random date/time In-Reply-To: References: <55E1092E.7913.18817E34@stuart.lexacorp.com.pg> Message-ID: Damn it, Gustav! You are a brilliant man. /Arthur ? From marksimms at verizon.net Sun Aug 30 11:33:47 2015 From: marksimms at verizon.net (Mark Simms) Date: Sun, 30 Aug 2015 12:33:47 -0400 Subject: [AccessD] Create a random date/time In-Reply-To: References: Message-ID: <000b01d0e341$a57c23a0$f0746ae0$@net> Interestingly when I can't find answers or solutions on really tech specific forums, a google search usually turns up hits on stackoverflow. That is an excellent tech website. From gustav at cactus.dk Mon Aug 31 10:42:40 2015 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 31 Aug 2015 15:42:40 +0000 Subject: [AccessD] Create a random date/time Message-ID: Hi all Forgot one thing: To shuffle the start position of the sequence of Rnd by calling Randomize. If missing, the function would generate the same sequence of dates whenever the application was relaunched. It is included now: Public Function DateRandom( _ Optional ByVal UpperDate As Date = #12/31/9999#, _ Optional ByVal LowerDate As Date = #1/1/100#, _ Optional ByVal DatePart As Boolean = True, _ Optional ByVal TimePart As Boolean = True, _ Optional ByVal MilliSecondPart As Boolean = False) _ As Date ' Generates a random date/time - optionally within the range of LowerDate and/or UpperDate. ' Optionally, return value can be set to include date and/or time and/or milliseconds. ' ' 2015-08-28. Gustav Brock, Cactus Data ApS, CPH. ' 2015-08-29. Modified for uniform distribution as suggested by Stuart McLachlan by ' combining a random date and a random time. ' 2015-08-30. Modified to return selectable and rounded value parts for ' Date, Time, and Milliseconds. ' 2015-08-31. An initial call of Randomize it included to prevent identical sequences. Const SecondsPerDay As Long = 60& * 60& * 24& Dim DateValue As Date Dim TimeValue As Date Dim MSecValue As Date ' Shuffle the start position of the sequence of Rnd. Randomize ' If all parts are deselected, select date and time. If Not DatePart And Not TimePart And Not MilliSecondPart = True Then DatePart = True TimePart = True End If If DatePart = True Then ' Remove time parts from UpperDate and LowerDate as well from the result value. ' Add 1 to include LowerDate as a possible return value. DateValue = CDate(Int((Int(UpperDate) - Int(LowerDate) + 1) * Rnd) + Int(LowerDate)) End If If TimePart = True Then ' Calculate a time value rounded to the second. TimeValue = CDate(Int(SecondsPerDay * Rnd) / SecondsPerDay) End If If MilliSecondPart = True Then ' Calculate a millisecond value rounded to the millisecond. MSecValue = CDate(Int(1000 * Rnd) / 1000 / SecondsPerDay) End If DateRandom = DateValue + TimeValue + MSecValue End Function /gustav From gustav at cactus.dk Mon Aug 31 15:33:21 2015 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 31 Aug 2015 20:33:21 +0000 Subject: [AccessD] Rounding. The collection. Message-ID: Hi all After many years I've managed to collect and polish the rounding functions I have for VBA and posted these at Experts Exchange: "Rounding values up, down, by 4/5, or to significant figures" http://rdsrc.us/4phszx The challenge is to handle both the very large and very small numbers of Double, floating point errors, and the large values and large count of decimals for Decimal - as well as symmetrical/asymmetrical rounding up/down of positive/negative values. /gustav From accessd at shaw.ca Mon Aug 31 17:11:07 2015 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 31 Aug 2015 16:11:07 -0600 (MDT) Subject: [AccessD] Rounding. The collection. In-Reply-To: Message-ID: <1616893902.5462200.1441059067160.JavaMail.root@shaw.ca> Excellent work Gustav. Jim ----- Original Message ----- From: "Gustav Brock" To: "Access Developers discussion and problem solving" Sent: Monday, August 31, 2015 1:33:21 PM Subject: [AccessD] Rounding. The collection. Hi all After many years I've managed to collect and polish the rounding functions I have for VBA and posted these at Experts Exchange: "Rounding values up, down, by 4/5, or to significant figures" http://rdsrc.us/4phszx The challenge is to handle both the very large and very small numbers of Double, floating point errors, and the large values and large count of decimals for Decimal - as well as symmetrical/asymmetrical rounding up/down of positive/negative values. /gustav -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com