Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. HOW TO MERGE IN ONE!

HOW TO MERGE IN ONE!

Scheduled Pinned Locked Moved Database
databasetoolstutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kibromg 0
    wrote on last edited by
    #1

    Hi All, I want to count records any time from Mid day(12:00:00.000') of a given date up to the next day MID Day get all the count in to the first date. For instance for a date '2008-04-23' count is made between '2008-04-23 12:00:00.000 and 2008-04-24 12:00:00.000'. If my date Query is Between '2008-04-20' and '2008-04-23' then 1. '2008-04-20' --------- count on '2008-04-20 12:00:00.000 and 2008-04-21 12:00:00.000'. 2. '2008-04-21' ---------- count on '2008-04-21 12:00:00.000 and 2008-04-22 12:00:00.000'. etc.. Can you give me a script for this one? Thank you regards

    B 1 Reply Last reply
    0
    • K kibromg 0

      Hi All, I want to count records any time from Mid day(12:00:00.000') of a given date up to the next day MID Day get all the count in to the first date. For instance for a date '2008-04-23' count is made between '2008-04-23 12:00:00.000 and 2008-04-24 12:00:00.000'. If my date Query is Between '2008-04-20' and '2008-04-23' then 1. '2008-04-20' --------- count on '2008-04-20 12:00:00.000 and 2008-04-21 12:00:00.000'. 2. '2008-04-21' ---------- count on '2008-04-21 12:00:00.000 and 2008-04-22 12:00:00.000'. etc.. Can you give me a script for this one? Thank you regards

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      hope this will help you... select count(*) from myTable where [columndate] >= substring(convert(varchar,columnName,20),1,10)+' 12:00:00.000' and [columndate] <= substring(convert(varchar,columnName,20),1,10)+' 12:00:00.000'


      I Love T-SQL

      modified on Thursday, April 24, 2008 4:26 PM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups