Professional Web Applications Themes

Insert Date into SQL 2000 - Macromedia ColdFusion

I'm trying to find out the best way to input a date into SQL Server 2000. I have yet to specify my datatype field or my query. But I need to input the following into my fields... mm/dd/yyyy So, I have a calendar that popups on my webpage to insert a formatted date into the readonly form field. Now for my cf insert. I'm thinking the following... <cfquery name="addTask" datasource=""> INSERT into svo_tasks (task_name, open_date) VALUES (<cfqueryparam value="#form.name#" CFSQLType="CF_SQL_VARCHAR">, <cfqueryparam value="#form.open#" CFSQLType="CF_SQL_DATE">) </cfquery> I was going to set my SQL Datatype to Date/Time. Is this the correct way. i read ...

Sponsored Links
  1. #1

    Default Insert Date into SQL 2000

    I'm trying to find out the best way to input a date into SQL Server 2000. I
    have yet to specify my datatype field or my query. But I need to input the
    following into my fields...

    mm/dd/yyyy

    So, I have a calendar that popups on my webpage to insert a formatted date
    into the readonly form field. Now for my cf insert. I'm thinking the
    following...

    <cfquery name="addTask" datasource="">
    INSERT into svo_tasks (task_name, open_date)
    VALUES (<cfqueryparam value="#form.name#" CFSQLType="CF_SQL_VARCHAR">,
    <cfqueryparam value="#form.open#" CFSQLType="CF_SQL_DATE">)
    </cfquery>

    I was going to set my SQL Datatype to Date/Time. Is this the correct way. i
    read in some places that CF_SQL_DATE is not supported by SQL Server? Any
    suggestions/recommendations would be much appreciated. Thanks beforehand!

    Sponsored Links
    muscleman Guest

  2. #2

    Default Re: Insert Date into SQL 2000

    For MS SQL, if your column has a datatype of "date/time", then use CFQUERYPARAM with a CFSQLTYPE of "CF_SQL_TIMESTAMP".
    mxstu Guest

  3. #3

    Default Re: Insert Date into SQL 2000

    Excellent. I'll give this a try.
    muscleman Guest

Similar Threads

  1. Insert and Retrieve binary objects with MS-SQL 2000
    By HeloWorld in forum Coldfusion Database Access
    Replies: 4
    Last Post: July 22nd, 12:29 PM
  2. How to insert date into db?
    By blu_sky in forum Coldfusion Database Access
    Replies: 7
    Last Post: June 1st, 02:47 AM
  3. Replies: 3
    Last Post: October 21st, 07:13 PM
  4. can't insert dates in SQL Server 2000
    By Ray at in forum ASP Database
    Replies: 3
    Last Post: July 29th, 08:13 PM
  5. Insert date
    By Wayne Morgan in forum Microsoft Access
    Replies: 1
    Last Post: July 13th, 12:55 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