Solved

Date in .fmt file

Posted on 2004-09-22
2
504 Views
Last Modified: 2008-03-06
Using a flat file for bcp is have a date in the format 20040922.  In the table, the field is datetime.  How do i convert to get the format file to load that column?
0
Comment
Question by:xoxomos
  • 2
2 Comments
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 250 total points
ID: 12126199
The format YYYYMMDD should be fine as is.  Just be sure to make it a character value, either using a format file or, I guess, by enclosing it in quotes.
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 12126213
That is, remember that dates in SQL must be character, not numeric.

For example, compare:

SELECT CAST(20040922 AS DATETIME)
SELECT CAST('20040922' AS DATETIME)
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question