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 strongm 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. johpje

    one-to-many compare problem

    Before you insert the new card into the db, just run the folowing update statement: UPDATE SigCardTable SET status = inactive WHERE docnum IN ( SELECT SigCardTable.docnum FROM SigCardTable INNER JOIN KeyWordsTable ON SigCardTable.docnum = KeyWordsTable.docnum WHERE CIFKey =...
  2. johpje

    Extrmemly Complicated Stored Procedure Problem

    Hi, just write the if statements complete in the stored procedure: SELECT Column1 From Table WHERE Column2 = 0 <cfif someVar = 3> AND Column3=0 </cfif> becomes: if (@someVar = 3) BEGIN SELECT Column1 FROM Table WHERE Column2 = 0 AND Column3=0 END ELSE BEGIN SELECT Column1...
  3. johpje

    Delete duplicates, how does this code work?

    Hi there, if you would run the inner select statement SELECT MIN([employeeID]) FROM table_name GROUP BY column1, column2 on let's say the folowing table employeeID [tab]column1 [tab]column2 1 [tab]John [tab]Smith 2 [tab]Marc [tab]Jones 3 [tab]John...
  4. johpje

    recordset paging frustration

    Replace the first query with "SELECT count(*) FROM email INNER JOIN members ON email.senderID = members.id WHERE recipientID = '" & session("ID") & "' AND delete_flag <> '" & session("ID") & "' AND folder='inbox' order by emailID;" and see if you still get a rowcount of 6 cheers Johpje
  5. johpje

    Getting Wrong ID

    BobbaBuoy, There isn't anything wrong with your query. The fact is that there actually exist 2 grades for the given rosterid. Please verify this by running following query: SELECT * FROM Grades WHERE RosterID = 2441 I'm quiet sure this will return two records with grade 10 and 11. cheers...
  6. johpje

    Using Parameter in a SELECT TOP

    globalstrata, TOP is used to return only a part of the total result set. You have to specify a number. In your case: CREATE PROCEDURE dbo.sp_GetRandomProduct @RecordAmount int out AS SELECT TOP 1 @RecordAmount=dbo.Product.ProductID FROM dbo.Product ORDER BY NEWID() specify...
  7. johpje

    Help with query

    shannanl, if you change following lines in both procedures: SET @Shift1_End = 601 SET @Shift2_End = 961 SET @Shift3_End = 1441 that should do the trick. Sorry for the late reply!
  8. johpje

    Help with query

    shannanl, Using some plain old numbers ans some basic matematics, you can come to a quite simple solution: CREATE PROCEDURE CalculateShifts @Offset_in int, @Offset_out int, @Shift1 int OUTPUT ,@Shift2 int OUTPUT , @Shift3 int OUTPUT AS DECLARE @Shift1_End as int DECLARE @Shift2_End as int...
  9. johpje

    select/join problem

    davidste, you should use table aliases for each diferent instance of t_users: SELECT t_proj.f_proj_id, t_proj.f_name, t_manager.f_forename, t_manager.f_surname, t_sponsor.f_forename, t_sponsor.f_surname FROM t_proj INNER JOIN t_users t_manager ON t_proj.f_manager_id = t_manager.f_user_id...
  10. johpje

    Faster way to retrieve this data set?

    Why don't you just execute SELECT [name], phone, product FROM TableX ORDER BY [name], phone Then when you fill whatever visual control you are using, just check when name and/or phone number change to create another parent object. regards, Johan
  11. johpje

    Database Normalization

    TimBiesiek, Theorecicaly you do not NEED the company link in the Property or the Meter table. Because as you mentioned yourself you can run an SQL to link from Meter table back to a Company. However, as r937 already mentioned, if for example the Meter-Company reference is frequently accessed...
  12. johpje

    Trying to parse a text file into a grid or tab or form or ?

    Is it realy necesary to have a tab per record? If not you maybe could only show one record at a time adding next and previous buttons or something to navigate. You could read all records in a array (or collection) to not have to access the file over and over? regards Johpje
  13. johpje

    Move cmdButton at runtime

    First of all, it seems a little unnecesary to do a For Each every time you wantto change the size of a control, can't you just call it directly by name? After all you do call them by name in some cases, like: <CODE> grid.Width = Me.fraCustomerView.Width - 50 grid.Height =...
  14. johpje

    Incremental data duplication

    Hi, Best to make a Stored Procedure where you create a cursor SELECT duplication_id, item FROM Table2 INNER JOIN Table1 ON (Table1.[id] = Table2.[id]) Then you do an insert (with new id) for each record in the cursor. Not recomended because the 500 is fixed that way, but for the...
  15. johpje

    returning strings in a COM method

    duh!! Thanks a lot mate!!
  16. johpje

    returning strings in a COM method

    Hi all, I'm making a COM object in VC++, but I have a problem with a method returning a string. the code in the COM class is goes like this: STDMETHODIMP CCOMCLASS::get_String(/* [out/retval] */BSTR *pVal){ _bstr_t tmp; tmp = _bstr_t(XXX); *pVal = tmp; return S_OK; } when i call the...
  17. johpje

    Dynamic Creation of new controls

    I encountered this post when i was looking for the same answer. :D If you're still looking: thread222-14902 might be helpfull regards, johpje
  18. johpje

    How do I make my ID field start from a specific number

    Blaises, When you make your table, just put these options for your id field: Data Type: bigint (any integer is ok, but if you start with 5 digits, you better keep it a bigint) Identity: Yes Identity Seed: 10000 Identity increment: 1 Regards, Johpje
  19. johpje

    Cookies in Sessions (Using ASP/VB)

    Thanks jkl Johpje
  20. johpje

    Cookies in Sessions (Using ASP/VB)

    Hi there, I'm developing an ASP.NET app. that requires a login with userID and Password. I would like the last userID that succesfully logged in to appear in the userID. At the moment it works, but only if i keep the same session open. If I, for example, completely close my browser and get back...

Part and Inventory Search

Back
Top