• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding Oracles to_date function

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I had a table with the columns like birthday which has the format dd/mm/yyyy hh:ss:mm.. and name . here the names can be repeated and i want to group the names in such a way that i want to get the count of name from some date to other date.(But i dont want to include the timestamp value while retrieving .

can anybody tell the query for this. i dont know exactly which function to use.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ramesh,
This forum suggests using trunc or going via a char. I don't remember if trunc works on timestamps though. Converting through to_char and then to_date would definitely work.
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TO_CHAR(TRUNC(SYSTIMESTAMP))

SELECT TO_CHAR(SYSTIMESTAMP) FROM dual;

TO_CHAR(SYSTIMESTAMP)
----------------------------------------------------------------
08-JAN-08 11.54.50.514628 AM -07:00


SELECT TO_CHAR(TRUNC(SYSTIMESTAMP)) FROM dual;

TO_CHAR(TRUNC(SYSTIMESTAMP))
----------------------------
08-Jan-2008
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic