Professional Web Applications Themes
  1. Moderated Post

    Default Help-ColdFusion - enabling a user to search for recordsin a database by entering a startand end date - (CREATEODBCDATE)

    Removed by Administrator
    James890 Guest
    Moderated Post

  2. #2

    Default Re: Help-ColdFusion - enabling a user to search forrecords in a database by entering a startand end date -(CREATEODBCDATE)

    I think the problem is your date format. My sense from running a similar test
    on my machine (with a db that has a similar type of table) was that CFMX
    interprets 01/09/2006 as January 9, 2006 and not, what I believe you are going
    for, September 1, 2006.

    If I'm reading your new end date correctly (and it's September and not
    January), try changing the end date to 09/01/2006.

    Hope that helps!

    craigkaminsky Guest

  3. #3

    Default Re: Help-ColdFusion - enabling a user to search forrecords in a database by entering a startand end date -(CREATEODBCDATE)

    But I want the format as dd/mm/yyyy. There must be a way to do that.
    James890 Guest

  4. #4

    Default Re: Help-ColdFusion - enabling a user to search forrecords in a database by entering a startand end date -(CREATEODBCDATE)

    Try formatting your dates first (before the CreateODBCDate call). I just tried
    this on my test page and it worked properly. I removed the DateFormat calls,
    keeping the dates in your format and it didn't work. See if something like the
    following will help:

    <cfset startDate = DateFormat("31/01/2006","dd/mm/yyyy")/>
    <cfset endDate = DateFormat("01/09/2007","dd/mm/yyyy")/>
    <cfquery name="memberJDateSearch" datasource="jpkelle2-access">
    SELECT *
    From members
    WHERE ((joinDate BETWEEN #CreateODBCDate(startDate)# AND
    #CreateODBCDate(endDate)#))
    </cfquery>

    craigkaminsky Guest

  5. #5

    Default Re: Help-ColdFusion - enabling a user to search forrecords in a database by entering a startand end date -(CREATEODBCDATE)

    thanks mate.
    I had to change the bit where you had DateFormat("31/01/2006","dd/mm/yyyy
    and replace "31/01/2006" with startDate though. Not sure why you put a date
    there. Anyway, it works perfectly. Fab

    James890 Guest

Similar Threads

  1. Entering Date into a MS SQL 2000 database
    By Nightfall_Blue in forum Coldfusion - Getting Started
    Replies: 12
    Last Post: January 25th, 05:59 AM
  2. Entering listbox values into database
    By sage703 in forum Coldfusion Database Access
    Replies: 1
    Last Post: June 22nd, 07:57 PM
  3. entering data into MS Access database
    By wwolff in forum Coldfusion Database Access
    Replies: 2
    Last Post: June 14th, 10:45 AM
  4. Entering date into Access
    By neilorourker in forum Coldfusion Database Access
    Replies: 5
    Last Post: May 30th, 01:28 PM
  5. Replies: 2
    Last Post: December 18th, 09:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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