Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Vulton

    Am I duplicating using IF and WHERE in a trigger?

    Fantastic Pwise, Thanks very much for the help. It works like a charm and is easy to read and add more case's to. Thanks again, Mark
  2. Vulton

    Am I duplicating using IF and WHERE in a trigger?

    Wow fast response thanks pwise, Only thing is the SET is seting different fields based on the inserted.LVR_Reason data. 14 = SET dbo.TblLotEvents.LE_OrderParts = inserted.LVR_TimeStamp 24 = SET dbo.TblLotEvents.LE_TurnOverlot = inserted.LVR_TimeStamp Thanks, Mark
  3. Vulton

    Am I duplicating using IF and WHERE in a trigger?

    Here is the SQL trigger. It seems to me that checking in the inserted table in the IF statement means I don't need it in the WHERE clause. Any help simplifying this would be appreciated. CREATE TRIGGER TriggerInstallationComplete ON [mpadmin].[TblLotVisitsReason] FOR INSERT AS IF EXISTS...
  4. Vulton

    Returning fields along with the MIN function

    I am going to keep using the Top 1 Order By method just in case when I get to altering the ".1" it needs to be bigger or gone. George really I can't thank you enough =) Mark
  5. Vulton

    Returning fields along with the MIN function

    I tried the Top 1 Order By way and it takes about the same amount of time as the WHERE statement one.
  6. Vulton

    Returning fields along with the MIN function

    AWSOME, Thank you again George I think that did it ... an acceptable speed with great results. I will have to play with the ".1" a bit to see what works best but your genius has helped me emensly and I learned a lot to. Posting code again for people with the same needs some day.. Dim MyDB As...
  7. Vulton

    Returning fields along with the MIN function

    Even if I am only conserned (for now) with points that are in southern California? Within say 300 miles of eachother max. I'm new at this whole GPS phone locate the employee thing but that Square root is a killer on the speed. Mark
  8. Vulton

    Find closest Latitude/Longitude in a table using actual location

    Greg, I ended up using your math with George's SQL from another post. Thanks for the help! Here is the code I ended up with... Dim MyDB As DAO.Database Dim MyRS As DAO.Recordset Dim MySQL As String Public Function NearestGeoFence(SearchLatitude As Variant, SearchLongitude As Variant) As...
  9. Vulton

    Returning fields along with the MIN function

    George I hope your feeling better and thanks for the help. I ended up using your method with someone elses math for speed. This is what I ended up with... Dim MyDB As DAO.Database Dim MyRS As DAO.Recordset Dim MySQL As String Public Function NearestGeoFence(SearchLatitude As Variant...
  10. Vulton

    Returning fields along with the MIN function

    ok here is what I have ... Select Min(Sqr((C_Latitude - " & SearchLatitude & ") ^ 2 + (C_Longitude - " & SearchLongitude & ") ^ 2)) As FakeDistance, C_JobNum, C_PhaseNumber From dbo_TblContract Group By C_JobNum, C_PhaseNumber But I am getting this ...
  11. Vulton

    Returning fields along with the MIN function

    This qry returns the wrong C_JobNum and C_PhaseNumber actualy it always returns the 1st record in the table rather than the record the Min statement is returning. Can someone please show me how to make this work correctly? SELECT Min(Abs([C_Longitude]- (-117.61583))+Abs([C_latitude]-...
  12. Vulton

    Find closest Latitude/Longitude in a table using actual location

    Now the function will execute but returns the first C_JobNum and C_PhaseNumber from the table rather than the correct C_JobNum and C_PhaseNumber for the record the Min statement is returning.
  13. Vulton

    Find closest Latitude/Longitude in a table using actual location

    I tried that already and I get a runtime error '3122': You tried to execute a query that does not include the specified expression 'C_JobNum' as part of the aggregate function.
  14. Vulton

    Find closest Latitude/Longitude in a table using actual location

    Greg, Great Idea keeping it simple =) and it works kind of ... I have this SQL statement... SELECT Min(Abs([C_Longitude]- " & SearchLongitude & ")+Abs([C_latitude]- " & SearchLatitude & ")) AS NearestJobPhase FROM dbo_TblContract; This gives me a value returned in NearestJobPhase. But I...
  15. Vulton

    Find closest Latitude/Longitude in a table using actual location

    I don't know how to make a query that will lookup "the closest" value and I don't think DLOOKUP will do that either.
  16. Vulton

    Find closest Latitude/Longitude in a table using actual location

    My code works but is WAY WAY to slow. Please help me to find a better/faster way to find the closest record to given cordinates. Currently I have code that when given a latitude and longitude it will go record by record thru a table with latitudes and longitudes calculating the distance between...
  17. Vulton

    Need for Speed (not the white stuff)

    Thanks Frederico, I am learning SQL/VB as I go and haven't gotten to stored Procedures yet but I did find DoCmd.RunSQL so now I have this... Private Function CountMolding() MySQL = "SELECT * FROM TblItemTransactionTracking WHERE [ITT_CJHLI] = '" & Right(Me.MM_BarCodeScanned...
  18. Vulton

    Need for Speed (not the white stuff)

    Ok I have read the FAQ's and searched I don't even know how many boards so now it's time to beg some help. I have several functions that read/write to a backend SQL database. I have read that it is not good to leave open a record set and to let connection pooling do its job. I had the recorsets...
  19. Vulton

    Why does this qry shut down access 2000?

    I have tried exporting to another DB... making a new one and remaking this qry... compacting and repairing... making a new 2000 db in 2003 access and then opening this in 2000. This qry will run but trying to save any change made to it closes access with no error. Perhaps someone will be good...
  20. Vulton

    If NewRecord in Tblone then append that record to tbltwo

    I have 3rd party application that uses a access database to keep track of "daily work". I can link to the tables in this aplications database and would like to append the information in the linked tables to my SQL tables as the aplication adds records to its tables. So... For each new record...

Part and Inventory Search

Back
Top