Results 1 to 2 of 2

Thread: Sql

  1. #1
    Kate Guest

    Default Sql

    I am trying to write an SQL statement (in asp to use with an Access database) that finds the average of the time taken (where time taken is the difference between two dates stored in the db.<BR><BR>I tried <BR>select AVG(DateDiff(n, Start, End) from Project group by Type;<BR>but it doesn&#039;t work!<BR><BR>Does any one have any suggestions???

  2. #2
    Join Date
    Dec 1969

    Default What error or results from that?

    It looks to me like it should have worked.<BR><BR>Though I think that END and TYPE are keywords in Access, so they probably should have been surrounded by [...] marks.<BR><BR>(And you are missing a right parenthesis, but I presume that is a typo from just your message, not your actual code.)<BR><BR>If<BR><BR>SELECT Avg( DateDiff( n, [Start],[End] ) ) From [Project] Group By [Type]<BR><BR>doesn&#039;t work, let us know and I&#039;ll go play with it some.<BR><BR>

Posting Permissions

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