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 8622013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:57:07+00:00 2026-06-12T06:57:07+00:00

Experts, please help… I have a datatable where I load in data from a

  • 0

Experts, please help…

I have a datatable where I load in data from a SQL Server database with tens of thousands of records and I have a procedure which outputs the entire datatable to a delimited text file.

My procedure to do so has code along the following lines:

For Each dtRow As DataRow In dtToWrite.Rows
     File.WriteLine(String.Join(strDelimitter, dtRow.ItemArray.Select(Function(Field) Field.ToString)))
Next 

Basically creating a delimited string from each datarow from my datatable using the string.join function.

Now, my problem is that I am pulling in Date values from SQL Server and so the final output has, for the date columns, values that look like:

“9/30/2012 12:00:00 AM”

Whereas I only want it to show:

“9/30/2012”

What is the best way to get my data to output ONLY the date portion from the datatable?

Thanks!

  • 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-12T06:57:08+00:00Added an answer on June 12, 2026 at 6:57 am

    In your SQL Query, you could convert the DateTime to a preformatted string. Like this:

    SELECT convert(varchar, getdate(), 101)
    

    For more date formats, check out the MSDN list of formats

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

Sidebar

Related Questions

With sincere help from experts in this wonderful forum, I have been able to
java experts can you please help me write detached queries as a part of
Please help. I am obviously no expert but using suggestions from this site, I
I do not have much experience coding systems dealing with web-services. Please help me
Could all those CORBA experts out there please help me with this one. I
This might be a piece of cake for java experts. Please help me out:
Rhino Mock Experts please help. Below Example of rhino mock is working fine. internal
I am stuck and need outside help from JSF experts with the following problem:
Hello Experts can somebody please indentify the problem with this server why this is
Telerik Experts, I need your help guys! In my grid, data gets bound on

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.