General Problem reading date fields

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default General Problem reading date fields

    Hi, I have a problem on my CFMX 6.1 server.
    I have this problem reading date fields from a SQLServer200 DB. In the field
    there is a value 24/06/2005 and width a cfm page I read 22/06/2005 without
    using formatdate function......


    p.s.
    We are in CH and the OS time Zone is GMT+1

    :confused;

    CFcippa Guest

  2. Similar Questions and Discussions

    1. Crosstab Query with Date Fields
      Pulling my hair out! Ok here's what I got: I need to output 2 queries with 2 different datefields with different Years (2 max) in tabular format...
    2. Sort the table per date or per fields name
      Hi alll can anyone tell me how i can make links with one recordset (or more) which each link is gonna sort the etails on the table for example my...
    3. text input of date and timestamp fields
      I'm working on a PHP frontend for a PostgreSQL db and I'm looking for the best way to create date or timestamp inputs. Let's take a date in the...
    4. Wierd problem reading fields in a tab-delimitted row...
      Everyone-- A wierd problem occurs in Ruby 1.67, 1.68 and 1.8 (and probably other versions?): If I step through rows in a tab-delimited text file...
    5. Problem with putting timestamps in date fields after Fix 10 (DB2 7.2)
      Hello out there, why does DB2 7.2 Fix 10 not more allow to put timestamps in date fields. In prior versions the time information was ignored....
  3. #2

    Default Re: General Problem reading date fields

    Hi

    can you post your code here...there may a chance of error in reding the db in
    your code.
    is all the data in your db is having the same date.?
    there may chance that you not reading different data and your checking other
    date.



    vkunirs Guest

  4. #3

    Default Re: General Problem reading date fields

    Hi, tnks for your help, indeed my reading problem was caused by an error in my
    select.

    But I have a problem similar inserting date from a wddx. I post the code of
    the wddx and of my insert page.

    In the wddx there is a filed called "DATA_VALORE_NETTO" when I read the wddx,
    before I Insert the records I show the date (at row <TD CLASS="grigio-8"
    align="right" width="33%">#Data_Valore_netto#</TD>) without formatting it.
    Already here I can see that all the dates are less one day (Es. wddx 24/06/2005
    --> read before insert 23/06/2005).

    I dont' know if the problem could be in the wddx datas where a read a
    suspicious value (see the bold) <dateTime>2005-5-31T0:0:0+2:0</dateTime>. But
    the OS timezone i setting to +1.



    <field name='DATA_VALORE_NETTO'>
    <dateTime>2005-6-20T0:0:0+2:0</dateTime>
    <dateTime>2005-6-20T0:0:0+2:0</dateTime>
    <dateTime>2005-6-20T0:0:0+2:0</dateTime>
    <dateTime>2005-6-23T0:0:0+2:0</dateTime>
    <dateTime>2005-6-23T0:0:0+2:0</dateTime>
    <dateTime>2005-6-23T0:0:0+2:0</dateTime>
    <dateTime>2005-6-23T0:0:0+2:0</dateTime>
    <dateTime>2005-6-23T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-20T0:0:0+2:0</dateTime>
    <dateTime>2005-6-20T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-6-20T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    <dateTime>2005-6-21T0:0:0+2:0</dateTime>
    <dateTime>2005-6-22T0:0:0+2:0</dateTime>
    <dateTime>2005-6-21T0:0:0+2:0</dateTime>
    <dateTime>2005-6-21T0:0:0+2:0</dateTime>
    <dateTime>2005-5-31T0:0:0+2:0</dateTime>
    </field>



    <CFDIRECTORY ACTION="LIST" DIRECTORY="#mydb_wddx_path#" FILTER="t_fondo.wddx"
    NAME="list_t_fondo">
    <CFIF LIST_t_fondo.RECORDCOUNT EQ 1>
    <CFSET WDDX_PRESENT="yes">
    <CFELSE>
    <CFSET WDDX_PRESENT="no">
    </CFIF>
    <CFIF WDDX_PRESENT EQ "yes">
    <CFFILE ACTION="read" FILE="#mydb_wddx_path#t_fondo.wddx"
    VARIABLE="thisWDDX"/>
    <CFWDDX ACTION="wddx2cfml" INPUT="#thisWDDX#" OUTPUT="wddx_t_fondo"/>
    <H1>Insert wddx<CFOUTPUT>#dateformat(now(),'dd/mm/yyyy')#
    #timeformat(now(),'hh:mm:ss')#</CFOUTPUT></H1>
    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="1" width="100%">
    <CFOUTPUT QUERY="wddx_t_fondo">

    <TR>
    <TD CLASS="grigio-8" width="25%">#NumValore#</TD>
    <TD CLASS="grigio-8" width="25%">#tipo#</TD>
    <TD CLASS="grigio-8" align="right" width="33%">#Data_Valore_netto#</TD>
    <CFIF Tipo NEQ "yield Enhancer" and tipo neq "directional" and tipo neq
    "event driven">
    <CFTRY>
    <CFQUERY DATASOURCE="#db_to#">
    update t_fondo
    set
    ordine=#ordine#,
    Nome='#Nome#',
    Valuta='#Valuta#',
    Valore_netto=#Valore_netto#,
    Data_Valore_netto=#createodbcdate(Data_Valore_nett o)#,
    Tipo='#Tipo#',
    Tipo_E='#Tipo_E#',
    Domicilio='#Domicilio#',
    Domicilio_E='#Domicilio_E#',
    Patrimonio=#Patrimonio#,
    Patrimonio_chf=#Patrimonio_chf#,
    nParti=#nParti#,
    Commento='#Commento#',
    Commento_E='#Commento_E#',
    Dom_Autoriz='#Dom_Autoriz#',
    Dom_fondo='#Dom_fondo#',
    Freque_NAV_I='#Freque_NAV_I#',
    Freque_NAV_E='#Freque_NAV_E#',
    Note_I='#Note_I#',
    Note_E='#Note_E#',
    All_In_Fee='#All_In_Fee#',
    Benchmark='#Benchmark#',
    Profilo_I='#Profilo_I#',
    Profilo_E='#Profilo_E#',
    Profilo_D='#Profilo_D#',
    Profilo_F='#Profilo_F#'
    <!--- ,perftd=#perftd#--->
    where NumValore='#NumValore#'
    </CFQUERY>
    <TD CLASS="green-8" width="25%">Record inserted</TD>
    <CFCATCH>
    <TD CLASS="red-8" width="25%">REcord not inserted</TD>
    </CFCATCH>
    </CFTRY>
    <CFELSE>
    <TD CLASS="orange-8" width="25%">Fund Type not for internet</TD>
    </CFIF>
    </TR>
    </TR>
    </CFOUTPUT>
    </TABLE>
    <CFELSE>
    <H1>Insert wddx mydb site</H1>
    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="1">
    <TR>
    <TD CLASS="red-9" WIDTH="500">WDDX not found</TD>
    </TR>
    </TABLE>
    </CFIF>

    CFcippa 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