Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Date/Time Problem

    I have a SQL Server 2000 database that extracts rates due to times of year.
    My problem is that when users extract times not set in the parameter there is
    no return of rate.
    My SQL is

    FROM dbo.houserate
    WHERE (house = '#pid#') AND (Startdate <=
    '#Dateformat(input1,"mm/dd/yyyy")# #timeformat(rightnow, "16:00:00")#') AND
    (Enddate >= '#Dateformat(input2,"mm/dd/yyyy")#')

    What is my best solution to fix this?


    koeniga Guest

  2. Similar Questions and Discussions

    1. MS Access time and date problem
      As the topic summary says, I am having trouble inserting both time and dates into a MS Access database. My database has three fields, eventdate,...
    2. A Date and Time problem?
      Hi, I've got a couple of problems i could do with a hand on, 1) I've made a test in Flash MX 2004, i would like to start something that resembles a...
    3. php mkdir touch time-date problem
      Dear all, I have a problem which I can not explain-understand. I hope someone can help me. I use php under WinXP. I want to copy a dir to...
    4. ASP Insert Date & Time Problem
      Hi All, I live in Australia and I have Access installed on my computer. Regional settings are set to Australian Standards (dd/MM/yyyy) I try to...
  3. #2

    Default Re: Date/Time Problem

    So you have a form with two dates and you want to user proof it? This happens
    to us so often that I wrote a custom tag for it. It was written when we were
    using version 4.5 so it could be improved upon, but the logic is:

    1. make sure both form fields are actual dates
    2. make sure they are in the right order
    3. make sure they fall within a pre-defined range.
    4. make sure they are not too far apart.

    Write some code to address all four of these, and you'll be fine. The version
    7 version of cfform makes the first one unnecessary.

    Dan Bracuk Guest

  4. #3

    Default Re: Date/Time Problem

    also consider #createodbcdate()# and #createodbcdatetime()# and #isdate()# if you are doing server-side validation of the dates before running the SQL query
    TurboMini Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139