#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    3
    Rep Power
    0

    Select data between two date... not that simple!


    Hello all

    I have the need to retreave data from a database
    with the params of a date field being between two times.

    these times are as such:

    between end_date where task = 14
    and end_date where task = 30

    does this question make sence, can you help me

    thanks!
    tom
  2. #2
  3. Wiking
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    3,608
    Rep Power
    26
    UN*X is sexy!
    who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    3
    Rep Power
    0
    i have two tables

    project -> task

    the project.date in the project table is the one i need to run the query on

    i need to show all records where the project.date is between
    dateA and dateB

    dateA = project.date where task.id =14
    dateB = project.date where task.id =30

    any clearer?

    tom
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,026
    Rep Power
    4210
    if the relationship between project and task is one-to-many, where each project can have multiple tasks but each task belongs to only one project, then the project.date for task 14 will be the same as the project.date for task 30

    so something is weird with your question

    please explain more


    rudy
    http://r937.com/
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    3
    Rep Power
    0
    at the moment i have to produce a list of records that are related to task 14

    and a seperate qry showing a list of records that are related to task 30

    these records have different dates for each record

    i need to produce a list of data that a different date field appers within these two dates
  10. #6
  11. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,026
    Rep Power
    4210
    please show the DDL (data definition language) for your tables, i.e. the CREATE TABLE statements, indicating which fields are related

    what do you mean by "a list of records related to task 14"?

IMN logo majestic logo threadwatch logo seochat tools logo