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 SkipVought 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: *

  • Users: Mary10k
  • Order by date
  1. Mary10k

    converting datetime error message

    I am trying to return the top 2 dates and values for each empi. If I ran Select T1.empi, t1.date, t1.value FROM plmCombinedLab as T1 Where T1.Date IN (SELECT TOP 2 T2.DATE FROM plmcombinedlab As T2 Where T1.EMPI = T2. EMPI ORDER BY T2.EMPI) would this return the correct top 2 lab values for...
  2. Mary10k

    converting datetime error message

    I'm not clear on your response. I ran your example and received the same error. Could you please elaborate? Thank you.
  3. Mary10k

    converting datetime error message

    Hello, I am getting the following error message when tryin to run the code listed below: Server: Msg 241, Level 16, State 1, Line 1 Syntax error converting datetime from character string. Code: SELECT T1.EMPI, T1.DATE, T1.VALUE FROM plmCombinedLab AS T1 WHERE T1.EMPI IN (SELECT TOP 2 T2.Date...
  4. Mary10k

    IIF Statement

    Thank you.
  5. Mary10k

    IIF Statement

    I'm trying to return one of two values if a person has a BMI>25 or if they have a weight of >210 I would like the true value to return. The following code returns BMI when neither of the above criteria is true. How can I return only the true value? Expr3: IIf([Weight]>="210" And [BMI]>="25"...
  6. Mary10k

    Top Function

    Thank you so much! This produced the results I wanted. You're a champ.
  7. Mary10k

    Top Function

    Yes, thank you. Here is what the query returned: MRN Login_Date_Time 00036871 7/9/2002 10:27:00 00036871 9/15/2003 13:15:00 When I open the table, this MRN contains the following rows: MRN Login_Date_Time 00036871 10/1/2002 10:20:00 AM 00036871 7/9/2002 10:27:00 AM 00036871 1/7/2002...
  8. Mary10k

    Top Function

    Thank you for the suggestions. I originally had a Group By in the query because of the Max function I tried. I just tried the above referenced code and still the same result as before. I am using a passthrough query to my SQL database, could that have anything to do with the reason why I am...
  9. Mary10k

    Top Function

    hI, Here is the latest : SELECT EE. MRN,EE.NAME,LABS.Login_Date_Time FROM EE INNER JOIN LABS ON LABS.MRN = EE.MRN AND LABS.Login_Date_Time IN (SELECT Top 2 Login_Date_Time FROM LABS WHERE EE.MRN = LABS.MRN GROUP BY EE.MRN, LABS.Login_Date_Time ORDER BY Login_Date_Time DESC);
  10. Mary10k

    Top Function

    This is still returning 2 records without the top 2 dates in desc order. Could it be due to a time stamp in the field?
  11. Mary10k

    Top Function

    I tried the Max function before posting this. It does not return the max 2 dates. It appears to select random top 2 rows.
  12. Mary10k

    Top Function

    Thank you. This works great, but I am not getting the Top 2 that I wanted. This is giving me the first two records in the sub query without selecting the top 2 by date. I thought it would start with the latest date, then the sencond latest date. Any suggestions? Thank you.
  13. Mary10k

    Top Function

    Hello, I have a table called Labs and a table called EE's. Each EE has many labs in the lab table. I am trying to figure out how I find the top 2 labs (based on date) and return that along with all of the fields in the EE table. Would I use a sub query? Something like this? SELECT * FROM ee...
  14. Mary10k

    Top 2 values for each record

    Hello, I have a table called Labs and a table called EE's. Each EE has many labs in the lab table. I am trying to figure out how I find the top 2 labs (based on date) and return that along with all of the fields in the EE table. Would I use a sub query? Something like this? SELECT * FROM ee...
  15. Mary10k

    Open and link forms

    I tried the code Private Sub Form_Open(Cancel As Integer) Me.Filter = "EMPI = " & Forms!Contact!EMPI Me.FilterOn = True End Sub and I am getting an error "missing operator in query expression". Any suggestions? Thank you.
  16. Mary10k

    Open and link forms

    Hello, I have a form with a button on it. I would like the button to open a second form when clicked. The problem I am having is linking the second form to the record in the first form. This is not a sub form/form example, they are two seperate forms. Can this be done. Thank you.
  17. Mary10k

    sub form not linking

    Hello, The form opens, but it is not linked to any record from the main form. When it opens, it is just a text box. No errors are happening. Thanks,
  18. Mary10k

    sub form not linking

    Hello, Thank you for your help. I tried the modifications listed above and they are not working. Any other suggestions? Thank you.
  19. Mary10k

    sub form not linking

    I have an Access form with a button on it that opens a sub form. I cannot get the sub form to open linking to the record id on the first form. Any suggestions? Here is the code I use to open the sub form: Private Sub Command178_Click() On Error GoTo Err_Command178_Click Dim stDocName As...
  20. Mary10k

    2 tables in ASP and only 1 displays

    Thank you. This did the trick. Do I need to close the record set somehow?

Part and Inventory Search

Back
Top