blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Browse by Tags

All Tags » SQL » Date range
  • PL/SQL Calendar table

    In addition to the T-SQL calendar table, which I have posted seperately, I went the whole hog and figured out the equivalent for Oracle. The only value I couldn't work out was the millisecond, which is not present on the standard date type in Oracle, but which can be retrieved and I am looking into this when I have time. This query uses the ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on April 24, 2007
  • T-SQL Calendar table

    After experimentation with various datepart and datename methods following my most recent blog post, I was able to identify many if not all the necessary components for constructing a calendar table.To do this I have combined these functions with the SQL to generate a list of dates as posted by Jamie some time ago. The resultant SQL is given ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on April 24, 2007
  • PL/SQL and T-SQL for Week Ending Date

    Recently my colleague challenged me to  find a method for identifying the week ending date for the week which any given date belongs to; i.e. say for a gven date which happens to be a Tuesday, what is the date of the end of the week? In this example, week ending is defined as a Sunday, however depending on how your server is set up, ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on April 24, 2007
  • T-SQL: Common date ranges; Daily, Weekly, Monthly, Yearly, Last 12 Months

    As promised in my original post on PL/SQL date ranges previously, below is a sql statement which can be used preceeding most queries in order to apply common date range lookups to the data the query returns. SQL Server Management Studio (SSMS) doesn't have an equivalent to the '&' functionality that TOAD has to ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on March 1, 2007
  • PL-SQL: Common date range lookups; Daily, Weekly; MTD; YTD; Last 12 Months

    As part of my current role as a tester I am often required to write the same basic expressions again and again in my queries, most noticeably to bring back data for specific date ranges, therefore for the benefit of anyone else out there who has to do likewise I have detailed below my method for returning the following basic ranges: Daily; Week ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on February 10, 2007
Powered by Community Server (Personal Edition), by Telligent Systems