473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

formatting a date column of transferred data in VBA access

Hi There,

I have a large data base, that has been transferred by the below code to the access as row data:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferText TransferType:=acLinkDelim, SpecificationName:="GainSpec", tableName:="RawData", _
  2.      FileName:=strPathFile, HasFieldNames:=False
In the other side, my new table has been build up based the below code :
Expand|Select|Wrap|Line Numbers
  1. createSQL = "CREATE TABLE " + tableName + " (SECURITYID STRING, SECURITYNAME STRING, ISIN STRING, SEDOL STRING, BLOOMBERGCODE  STRING, INSTRUMENTTYPECODE STRING, PRICEDATE String, Bloomberg DOUBLE, ICEExshare DOUBLE, Reuters DOUBLE, MidSpread DOUBLE, ID AUTOINCREMENT PRIMARY KEY);"
Now, i need to append info from row data with other quries info that i have to be into new table but i realised "pricing date" column in "Row Data" is based on text( and month name ) however the pricing date in other info are based on date( month number) and as they get group by pricing date, i'm not able to append them and i get "mismatch error".
Any thought would be appreciated

Cheers,
Zoe
Jan 23 '20 #1
2 1401
NeoPa
32,556 Expert Mod 16PB
Hi Zoe.

Welcome to Bytes.com.

Two thoughts occur immediately :
  1. Create the table to match the actual data you have to store in it.
  2. Load the data originally into a staging table, then populate the proper table with a Query based on the staging table.

The latter option is a concept that is very important and often required when dealing with the transfer of data. Particularly where you are not in control of the format of the data to be transferred.
Jan 24 '20 #2
NeoPa
32,556 Expert Mod 16PB
I would also draw you attention to Before Posting (VBA or SQL) Code.

You're a new member so there are tricks and tips that not only protect us, but also help you get the best of the help that's available. The fact that you are not new to such work is also clear, so I expect you'll understand easily when I point out that without knowing such details as what you're using for a tableName we can only guess what the actual SQL string looks like.

Also, it probably mentions this in the linked article but you'll do yourself a favour by formatting the SQL in such a way that it can be seen easily on the web page of the forum. The easier you make it for other members and experts to read and understand your problem, the more chance you have that they will be invested in spending their time trying to help you.
Jan 24 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ray | last post by:
Date problem. Using non American date formats with Microsoft Access and Visual Basic. I set my regional settings to English(Ireland) or English(United Kingdom) and my date appears in Access as...
4
by: Rich Hurley | last post by:
We've just installed SQL Server 2000 on one of our servers and have noticed a strange behavior. When clicking the column headings in the job display in Enterprise Manager, the list is sorted (first...
2
by: Myk | last post by:
Hello All, None of the solutions I have found in the archives seem to solve my problem. I have a date column in my tables (stored as a char(10)) which I would like to append a leading zero to...
5
by: news.swissonline.ch | last post by:
Hi, DB2 7 FP 13 Windows XP I have a table in which on of the columns has the data type DATE. The date column is indexed (asc non-unique index). Every SQL I create which tries to filter by...
0
by: Manystrengths | last post by:
I must warn all of you willing to help me that this is my first go at designing a functional data access page. Please bear in mind that we all start somewhere so if I should be asking the absolute...
0
by: astersathya | last post by:
Date Format in MS Access using a query Hi I want to alter the existing column's format using the alter query. The issue I am facing is I want to set the default date format of an existing...
12
by: rodrigo21 | last post by:
hello, On a dynamic html page I have a table with a date column <td><?php echo $row_resultado_viajes; ?>&nbsp; </td> I want the date to be displayed in other format so I am using the date...
6
by: Paul Swanton | last post by:
Hi, I'm currently attempting to create a query in Access 2003 on a SQL database where I'm trying to format a date column, that's currently set as YYYYMMDD, to show as DD/MM/YYYY. Using that...
6
by: HiGu | last post by:
I need to sort a field that displays date on a form.This field is a textbox that simply displays a column 'date' from sql database i.e. it is not of type datetime when displayed.I had two ideas in...
0
by: ncsthbell | last post by:
I am on release MS Access 2002. I need to be able to import a spreadsheet of data into a existing table in an access database. I am doing this by using the DoCmd.TransferSpreadsheet command. The...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.