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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:41:06+00:00 2026-06-09T19:41:06+00:00

I need your help to figure out and maybe solve this problem. I have

  • 0

I need your help to figure out and maybe solve this problem.

I have a DataReader and when use the function GetDateTime, to read a Date column, I get the min value. I don’t see a GetDate function. I tried changing the datatype of the column to Datetime, in order to both have the same datatype, but it’s the same result.

This is the definition of the table:

CREATE TABLE [dbo].[Solped](
    [docNumber] [int] NOT NULL,
    [docType] [nvarchar](255) NOT NULL,
    [createDate] [date] NULL,
    [hora] [time](2) NULL,
    ....

This is where I read the database:

string sql = "SELECT * FROM Solped order by docNumber DESC";
            System.Console.WriteLine(sql);
            SqlCommand cmd = new SqlCommand(sql, con);
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                solped = new Solped();

                solped.docNumber = reader.GetInt32(0);
                solped.docType = reader.GetString(1);

                DateTime dt = reader.GetDateTime(2);
                solped.fecha = dt;

This is the value presented when debbuging:

dt = {1/1/0001 12:00:00 AM}

And this is the presented value in the program:

Date(1345089600000)

I am totally confused about that I don’t know what function or actions should I take to solve the problem. If you may help, I would greatly appreciate that. 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-09T19:41:08+00:00Added an answer on June 9, 2026 at 7:41 pm

    Look like you have the date and the time in two different columns in your table, try this

    SELECT DocNumber, DocType, 
    CAST(CAST(createDate as varchar(10)) + ' ' + CAST(hora as varchar(12)) as datetime) as fullDate
    FROM Solped
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i have the this problem, i need your help to figure out what
maybe you guys can help me figure this out: I have a Dictionary and
I need your help to figure out how to make a query. My idea
I need your help. All day Im trying to figure out why I get
I need some help to figure this out .. I am getting data from
I need your help on how to figure out the following: With the following
I need your help. Say I have a code inside a for statement similar
I need your help to translate a query into pyes. This query is working
for the last hour I have been trying to figure this out myself but
I am new at ios programming and I need some help, can't figure out

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.