Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8131685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:09:29+00:00 2026-06-06T09:09:29+00:00

When we define a record set in VBA & read the data from database,

  • 0

When we define a record set in VBA & read the data from database, recordset converts its datatype to Table’s column data type.

Dim rs as adobb.RecordSet 
Set rs = CmdSqlData.Execute() ' After this rs fields will be stored based on table's datatype

Is there any way to set the recordset itself to String and Perform,

Set rs = CmdSqlData.Execute()

For Eg: if there is a timestamp value(which has integer value) in Database table definition, Recordsset sets its field datatype to timestamp.

The problem is , In database,

Time value is 12345 (Not date & time) but when record set reads it, it
comes as For Eg: 23-06-2012
10:15:23

I wanted the value as 12345

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:09:30+00:00Added an answer on June 6, 2026 at 9:09 am

    I managed to convert this timestamp alone for now. But There are number of timestamp format available. I can not automate the SQL query to convert from different datatype to string.
    I require VBA to read the TERADATA VALUE as string
    What i did ,

        If Field_format = "99:99:99" then
        Sql = "Select Cast(Field_format as integer) from Mytable"
        Elseif Field_format = "99:99:99.999" then
        Sql = "Select Cast(Field_format as Float) from Mytable"
        Elseif Field_format = "99:99:99.999" then
        Sql = "Select Field_format from Mytable"
        End if
    ...
    Set rs = CmdSqlData.Execute() 
    

    Kindly note there are so many datatypes available in teradata (Around 400+) , i can not convert everthying as above.

    I just wanted to VBA to read Teradata values as string.
    Wondering There is no VBA Expert in StackOverflow

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SQLBULKCOPY to copy some data-tables into a database table, however, because the
<?php error_reporting(E_ALL); $url = 'saved_report.xml'; define('XML_HEADER', '*RWRESPONSE*RESPONSE*DATA*HEADER*COLUMN'); define('XML_ROW', '*RWRESPONSE*RESPONSE*DATA*ROW*COLUMN'); $headers = array(); $rows =
I'm experiencing a problem with my VBA application. I need to define a Recordset
I am a beginner in Excel VBA. I want to query data from Teradata
I want to define record with procedure or function. Can you help with syntax?
I have the following code snippet: #ifdef DO_LOG #define log(p) record(p) #else #define log(p)
I am writing a program that needs to read a set of records that
I am receiving a NullReferenceException when trying to add a record to a table
Im working on a legacy oracle database with a slightly odd table naming convention
I'm not really sure how to define this. I have a table that has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.