Recent content by cheekybuddha

  1. cheekybuddha

    Solved Help with subqueries

    Ah! I completely missed the PRON_ID! How about this: -- ... INNER JOIN ( SELECT a.PRON_ID, a.CurrentProcPointID, a.TimeStamp, a.ProcPointStartDate, ( SELECT TOP 1 b.ProcPointStartDate FROM tbl_Actual_PROC_Point AS b WHERE...
  2. cheekybuddha

    Solved Help with subqueries

    Interesting! I wonder where that 12/152025 came from in the second record. My guess it came from the Timestamp tie-splitter. I know you have a solution, so no worries if you can't be bothered, I'm still curious if either of the following variations might work (since I have no data to test...
  3. cheekybuddha

    Solved Help with subqueries

    Also curious as to how different this query would be from yours SELECT p.PRON, a1.TimeStamp, c.[Current Proc Point], a1.ProcPointStartDate, Nz(a1.EndDate, Date()) AS EndDate, Int(Nz(a1.EndDate, Date()) - a1.ProcPointStartDate) AS TimeInProc, a1.[Updated By], c.PALT FROM (...
  4. cheekybuddha

    Solved Help with subqueries

    Sometimes speed is the issue, or a requirement to have data frozen at a fixed point in time, but often it seems to be done unnecessarily. Using the SELECT query directly is usually safer since it will reflect live data and not need to be updated when underlying data changes.
  5. cheekybuddha

    Solved Help with subqueries

    I'm always curious why you need to insert data that can be got with a select query into another table when you could just use the query instead?
  6. cheekybuddha

    Solved Help with subqueries

    Ouch! Just noticed CurrentProcPointID used in the join isn't selected in the subquery - will edit the query in Post #4 to correct that.
  7. cheekybuddha

    Form as Form? or String?

    If this Requery code is for two listboxes in the same form, then why isn't the code in that form's module? If you put this code in the form's module: Sub RequeryLstBx() Const lst1 As String = "lstName", _ lst2 As String = "lstTrans" Dim lst As Variant, lsts As Variant lsts =...
  8. cheekybuddha

    Solved Help with subqueries

    NB. All the above is complete AIRCODE! 😬
  9. cheekybuddha

    Solved Help with subqueries

    Next, add in the other fields from tbl_Actual_PROC_Point : SELECT a.PRON_ID, a.CurrentProcPointID, a.TimeStamp, a.ProcPointStartDate, ( SELECT TOP 1 b.ProcPointStartDate FROM tbl_Actual_PROC_Point AS b WHERE b.ProcPointStartDate > a.ProcPointStartDate ) AS EndDate...
  10. cheekybuddha

    Solved Help with subqueries

    Break it down into bitesize chunks. First make sure you get the right end dates from the start dates. SELECT a.PRON_ID, a.ProcPointStartDate, ( SELECT TOP 1 b.ProcPointStartDate FROM tbl_Actual_PROC_Point AS b WHERE b.ProcPointStartDate > a.ProcPointStartDate ) AS...
  11. cheekybuddha

    bad bracketing

    Well that depends ... ! This will work with your function as you have it currently, but is not a good solution: Me.lstYourlistBox.RowSource = "SELECT ... FROM qryAllPurpose WHERE " & GetDateRange("qryAllPurpose].[CkDate", 48) Do as Ron suggests and remove the square brackets. Put them in when...
  12. cheekybuddha

    Retrieving data from an edge browser window

    If the above fails, you can also try adjusting JStoExecute to be a function: ' ... JStoExecute = "() => document.getElementById('SupplierModel_TotalClaimForGlassesOrContactLenses').value" ' ...
  13. cheekybuddha

    Solved Query with multiple parameters not working

    Arnel's SQL is effectively identical to mine.
  14. cheekybuddha

    Retrieving data from an edge browser window

    Are you sure that you are using the correct function for the job? EdgeBrowser control docs I think you might actually need RetrieveJavascriptValue instead. What happens if you try: Dim JStoExecute As String, result As String JStoExecute =...
  15. cheekybuddha

    Retrieving data from an edge browser window

    it must be a function rather than a sub. try: Debug.Print Me.EdgeBrowser0.ExecuteJavascript("document.getElementById('SupplierModel_TotalClaimForGlassesOrContactLenses').value")
Back
Top Bottom