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 Wanet Telecoms Ltd 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

    ...SearchLongitude As Variant) As Variant If SearchLatitude <> 0 Or SearchLongitude <> 0 Then Set MyDB = CurrentDb MySQL = "Select * From dbo_TblContract " MySQL = MySQL & "Where sqr((C_Latitude - " & SearchLatitude & ") * (C_Latitude - " & SearchLatitude & ") " MySQL =...
  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

    ...SearchLongitude As Variant) As Variant If SearchLatitude <> 0 Or SearchLongitude <> 0 Then Set MyDB = CurrentDb MySQL = "SELECT * From dbo_TblContract " MySQL = MySQL & "Where (Abs([C_Longitude] - " & SearchLongitude & ") " MySQL = MySQL & "+ Abs([C_latitude] - " &...
  9. Vulton

    Returning fields along with the MIN function

    ...SearchLongitude As Variant) As Variant If SearchLatitude <> 0 Or SearchLongitude <> 0 Then Set MyDB = CurrentDb MySQL = "SELECT * From dbo_TblContract " MySQL = MySQL & "Where (Abs([C_Longitude] - " & SearchLongitude & ") " MySQL = MySQL & "+ Abs([C_latitude] - " &...
  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

    ...Long1 = Long1 / 57.29577951 Long2 = Long2 / 57.29577951 If lat1 = lat2 And Long1 = Long2 Then Distance = 0 Else If (Sin(lat1) * Sin(lat2) + Cos(lat1) * Cos(lat2) * Cos(Long1 - Long2)) > 1 Then Distance = 3963.1 * ArcCos(1) Else Distance = 3963.1 *...
  17. Vulton

    Need for Speed (not the white stuff)

    ...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, Len(Me.MM_BarCodeScanned) - 7) & "'" Set MC_RS =...
  18. Vulton

    Need for Speed (not the white stuff)

    ...it is processing them. ANY suggestions would be GREATLY appreciated. Please and Thanks. Private Function CountMolding() MySQL = "SELECT * FROM TblItemTransactionTracking" Set MC_RS = MyDB.OpenRecordset(MySQL, dbOpenDynaset, dbSeeChanges) MySQL = "SELECT * FROM...
  19. Vulton

    Why does this qry shut down access 2000?

    ...or not. SELECT Sum(IIf([TblPartsInfo].[PI_SolidPartID]=19 Or [TblPartsInfo].[PI_SolidPartID]=22 Or [TblPartsInfo].[PI_SolidPartID]=23,([LL_CabQty]*[P_Qty])/3,[LL_CabQty]*[P_Qty])) AS QtyParts, IIf([TblPartsInfo].[PI_StockPart]=-1 Or...
  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