Results 1 to 3 of 3

Thread: The MOTHER of all PICKLES

  1. #1
    Join Date
    Dec 1969

    Default The MOTHER of all PICKLES

    I have a huge QUEST!!!<BR>I have 2 tables. <BR>T1--- SITE_ID, DATE, TIME, FLOW<BR>T2--- SITE_ID, DATE, TIME, P. <BR>I need to create a QUERY which allows me to link the two tables based on time and combine the FLOW and P.<BR>QUERY--- SITE_ID, DATE, TIME, FLOW, P<BR><BR>However, the date and time do not exactly match in both tables<BR>The two tables already exist will all the data.... I just have to analyze the data.<BR>Im using an Access database<BR>See the problem is that the times dont match up<BR><BR>In both tables date and time are in DATE/TIME data-type<BR><BR>EG<BR><BR>T1<BR>SITE_ID, DATE, TIME, FLOW<BR>1,1/1/01,12:01,0.2<BR>1,1/1/01,13:07,0.3<BR>1,1/1/01,14:25,0.25<BR>1,1/1/01,15:02,0.2<BR>1,1/1/01,16:20,3.5<BR>1,1/1/01,17:37,4.2<BR><BR>T2<BR>SITE_ID, DATE, TIME, P<BR>1,1/1/01,14:37, 0.002<BR>1,1/1/01,17:50,0.2,0.031<BR><BR>REQUIRED RESULTS FROM QUERY<BR>SITE_ID, DATE, TIME, FLOW, P<BR>1,1/1/01,12:01,0.2,0.002<BR>1,1/1/01,13:07,0.3,0.002<BR>1,1/1/01,14:25,0.25,0.002<BR>1,1/1/01,15:02,0.2,0.031<BR>1,1/1/01,16:20,3.5,0.031<BR>1,1/1/01,17:37,4.2,0.031<BR><BR>If the date of P is equal to or less then the date of Flow, then that value of P will be appended onto the QUERY table until a new value of P appears....<BR>Any suggestions????<BR>

  2. #2
    Join Date
    Dec 1969

    Default I don't think you want a join?

    something more like:<BR><BR>select<BR> T1.site_id,, T1.time, T1.flow<BR> (select top 1 T2.P from T2 where &#060;=<BR>from<BR> T1<BR><BR>I haven&#039;t tested that though.<BR><BR>c

  3. #3
    Join Date
    Dec 1969

    Default No go...

    Yeah, was trying some stuff like that but havent been able to get any decent results.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts