Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1abxqM-0005Xx-Vo for pgsql-odbc@arkaria.postgresql.org; Fri, 04 Mar 2016 22:05:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1abxqM-0005jB-DC for pgsql-odbc@arkaria.postgresql.org; Fri, 04 Mar 2016 22:05:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1abxqL-0005iT-US for pgsql-odbc@postgresql.org; Fri, 04 Mar 2016 22:05:06 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1abxqE-0004T4-AP for pgsql-odbc@postgresql.org; Fri, 04 Mar 2016 22:05:05 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id AB9B020898 for ; Fri, 4 Mar 2016 17:04:56 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Fri, 04 Mar 2016 17:04:56 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=cwNGweZGLd7lVSc3rzhY6jZ15QQ=; b=WIhXWf H0ufR7u4YFwWTfZJ7ZxX3GE1ZnFi40k1eaPNsSZu4SW5rsZOsJn1mzPQ1NWxQkmw qQRR+xu7F4yASf4PoZ1AA26C9mwyJo1uxb/3aw4ruWWx719+imzZBpMcssMpdbdi EbgNrCchyIlloY7f1L73YA5DqqCJ2g3OBcpJw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=cwNGweZGLd7lVSc 3rzhY6jZ15QQ=; b=NEie5xkmSk/hIya5pVbgl4moeWxA/zRfyNQFwn13Voa7XoT r9AGgjRyexlGl3gYrUc68p8ennAA9wb52/8umwC21ZbkZFt8JHJP9993xjufhc9B knA2NU8GAeNdWchsn506NOo0DEzn3M2X6+InHfBI/BWJkfa8A68lCX0ozu8g= X-Sasl-enc: Fo2YI5vRitF3L9YI9au9UdCpF3OXw1s3WTuU4H9xmfc4 1457129096 Received: from [192.168.1.2] (174-21-70-246.tukw.qwest.net [174.21.70.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 170B96801BC; Fri, 4 Mar 2016 17:04:55 -0500 (EST) Subject: Re: Obtaining hundredths of a second data from time data types To: Scott Ferrett , pgsql-odbc@postgresql.org References: <56D92DAB.9010806@ferrettconsulting.com> <56D9D1C1.4060506@aklaver.com> <56D9FC10.50107@ferrettconsulting.com> From: Adrian Klaver Message-ID: <56DA0639.8050006@aklaver.com> Date: Fri, 4 Mar 2016 14:03:37 -0800 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56D9FC10.50107@ferrettconsulting.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 03/04/2016 01:20 PM, Scott Ferrett wrote: > Here is a screen shot from ODBCTest after Issuing "SELECT ts, t FROM > TestTable" and binding an SQL_C_TYPE_TIMESTAMP to each of the two columns: > > > > As you can see, the timestamp has the hundredths part filled in where as > the time part does not. > > I also tried binding to SQL_C_CHAR as a work-around. But this made no > difference, producing: > > > > This is the result of the same select statement run from pgAdmin III > showing that there the hundredths part is returned for both fields: > > Looks like this is the reason: https://msdn.microsoft.com/en-us/library/ms712436%28v=vs.85%29.aspx The identifier for the time ODBC SQL data type is: SQL_TYPE_TIME to SQL_C_TYPE_TIMESTAMP None[b] Data[c] 16[d] [c] The date fields of the timestamp structure are set to the current date, and the fractional seconds field of the timestamp structure is set to zero. > > > Cheers, > Scott > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc