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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:47:58+00:00 2026-06-13T15:47:58+00:00

I use C# .NET I need run auto datetime in my project and save

  • 0

I use C# .NET

I need run auto datetime in my project and save in SQL Server

Exam.

In SQL Server

Datetime    | workDate
-------------------------
25-10-2012  | work
26-10-2012  | work
28-10-2012  | work

In my project, I’m searching datetime between 25-28

I need program output

25-10-2012  work
26-10-2012  work
27-10-2012  null
28-10-2012  work

But now I get:

25-10-2012  work
26-10-2012  work
28-10-2012  work

Because my data save status work only when status don’t work it’s not save in database.

How can I use insert value null, show data to my project and save in SQL Server?

Thanks For your Time :).

  • 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-13T15:47:59+00:00Added an answer on June 13, 2026 at 3:47 pm

    You could use a recursive CTE to generate a list of days.

    ; with  AllDays as
            (
            select  cast('2012-10-25' as date) as dt -- Start date
            union all
            select  dateadd(day, 1, dt)
            from    AllDays
            where   dt < '2012-10-28' -- End date
            )
    select  convert(varchar(10), ad.dt, 105)
    ,       workDate
    from    AllDays ad
    left join
            Table1 t1
    on      t1.Datetime = convert(varchar(10), ad.dt, 105)
    

    Example at SQL FiIddle. The convert changes the SQL Server date to a varchar(10) in format 105, the Italian format.

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

Sidebar

Related Questions

Is there any way to use server controls in ASP.NET MVC? Specifically I need
I need to run .Net code in Sql and I'm trying to decide between
I use asp.net 2 and need to consume a 3rd party HTTP GET call
I need recommendations on a good Unit Testing book for use with ASP.NET MVC.
I am trying to use a headless browser in .Net and I need it
Using ASP.NET MVC + jQuery : I need to use some values owned by
I need to write a use cases to test the asp.net mvc applicatoin. How
i need to have the 3d of this: http://jsfiddle.net/dAdKm/ but when i use this
I've never had the need to really ever use any of the .NET Data
I am developing an asp.net web application. I need to use java script to

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.