Not a Julian Date. How CVTDATE works with MS SQL

by Marie 14. June 2012 18:15

I was having a problem converting what I thought to be a Julian Date coming from iSeries into SQL Server.  I wasn't able to use the CVTDATE funciton that works wonders in iSeries because I was building an SSIS package to import the data into sql server.  I was getting result like 5024-07-26 for my date field.  So with a little research, I came accross this forum that explains how the CVTDATE works and how to convert these fields in MS SQL.  Enjoy!

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=108666

Not a Julian Date.  How CVTDATE works with MS SQL

When SQL server is installed into an AS400 and a data mirror is replicated what is the best way to do the date conversion in SQL Server.

Currently SQL Server pulls the date as (CYMD)

what does the '1' in 1080813 indicate ?

declare @d varchar(7) select @d = '1080813' select convert(datetime, case when left(@d, 1) = '1' then '20' + right(@d, 6) else '19' + right(@d, 6) end, 112)

It says Centry (21st) They Year, Month , Date (CYMD)


The Money:

CASE WHEN LEN(Field) = 7 THEN CAST('20' + RIGHT(Field, 6) AS DATETIME) ELSE CAST('19' + RIGHT(Field, 6) AS DATETIME) END

 

Also check out Converting from a Julian Date.  Scalar Function to use in MS SQL

Tags:

iSeries

Not Enough Cheat Sheets At Your Fingertips!

by Marie 13. June 2012 17:18

Now Where did you put those cheat sheets?  Cheat sheets are always a handy tool to have around when you need to code something fast or just as a refresher to some code you haven't used in a while.

Top Design Mag has compliled a List of Cheat Sheets to use when devloping in HTML, CSS, JavaScript, ASP.NET, PHP and MySQL.

Check them out to save you some of your precious time!  Have you come Accross any Developer Cheat Sheets?  I would love to see them.  Share them below.

Tags: , , , , , , ,

Cheat Sheets

How do I write a query that outputs the row number as a column?

by Marie 12. June 2012 17:10

http://stackoverflow.com/questions/438610/how-do-i-write-a-query-that-outputs-the-row-number-as-a-column


This is how you output a row number in iSeries in a Select statement:

SELECT ROW_NUMBER() OVER (ORDER BY beatle_name ASC) AS ROWID, * FROM beatles

Tags:

iSeries

JQuery Examples

by Marie 2. June 2012 02:11

Here is a list of jQuery Examples, plugins and Tutorials that I have found.  Some of them you may have already found. 

 

50 Amazing jQuery examples

20 Useful jQuery Plugins

100 Popular jQuery Plugins

jQuery Tutorials

 

Tags: ,

jQuery | Misc

JSFIDDLE

by Marie 2. June 2012 02:04
http://jsfiddle.net/TWZqP/1/embedded/result/

Tags:

Online Editors

StackOverflow is Awesome

by Marie 16. May 2012 17:14

I have been using StackOverflow to figure out my out coding issues for the last couple of years. But it wasn't until I was doing a powershell script that I learned about the other sites that stackoverflow has its hands on.  Check out the other sites for some awesome information.

Your probably already familiar with Stack Overflow if your a developer.  This site is one of the best sites out there for finding a solution to a problem that you have been struggling over.  I've used it to look up a simple css question or to find out how to get a powershell script working. 

Stack Overflow doesn't stop there.  They have a lot of sister sites out there.  Something to take a look at:

While I usually use Uncle Google to get a lot of my answers.  Stack Overflow always finds a way into my ToolBox.  Let me know your thoughts, leave a comment.

Tags: , , ,

StackOverflow

Debugging SSIS

by Marie 15. May 2012 19:51

Working on a current solution to an SSIS issue, I came across this solution on Stack Overflow.  It wasn't the exact solution I was looking for but pointed me in the right direction. 

 

Tags:

StackOverflow

Write faster SQL Server Queries

by Marie 10. May 2012 01:40

Watch this Video from Expert Exchange where Tim Chapman speaks about writing faster SQL Queries.

Some of the things convered in this Video:

  • Look at how to write efficient queries and how not to write effecient queries.
  • Learn how to handle dates in the where clause to get more efficient queries.
  • Take a look at parameter sniffing.
  • Learn to use the executionplan to see how your sql queries are performing.  Then learn ways to improve areas that can speed up the performance of your queries.

 

Tags:

Coding

10 Usability Heuristics

by Marie 10. May 2012 00:38

Jakob Nielsen created the Ten Usability Hueristics.  Watch this video to gain a quick understanding of what these ten steps are and how you can begin using them in your daily tasks as a developer.

  1. Visibility of System Status
  2. Match Between System and The Real World
  3. User Control and Freedom
  4. Consistency and Standards
  5. Error Prevention
  6. Recognition or Recall
  7. Flexibility and Efficency of Use
  8. Aesthetic and Minimalist Design
  9. Help Users Recognize, Diagnose and Recover from Errors.
  10. Help and Documentation

Tags:

UI Patterns

How to find slow SQL queries in your database

by Marie 10. April 2012 01:07

Are you using sp_who or sp_who2?  Learn what your SQL Server is doing performance wise using an alterntaive to sp_who or sp_who2.  Who Is Active is a free tool that can help manage your server. 

Get WhoIsActive and try it out today.

 

Tags:

Coding

SSIS For Developers

by Marie 10. April 2012 00:58

I've recently benn introduced to SSIS and have had to quickly get up to speed to solve a problem with an SSIS package.

Check out this Video.  It is a great introduction to see what you need to develop SSIS and also explain what SSIS is and examples that you can use in your projects.

 

Tags:

Coding

The 23 Gang of Four Design Patterns

by Marie 23. February 2012 13:30

The Gang of Four Design Patterns
    1. The Strategy design pattern
    2. The Decorator design pattern
    3. The Factory Method design pattern
    4. The Observer design pattern
    5. The Chain of Responsibility design pattern
    6. The Singleton design pattern
    7. The Flyweight design pattern
    8. The Adapter design pattern
    9. The Facade design pattern
    10. The Template design pattern
    11. The Builder design pattern
    12. The Iterator design pattern
    13. The Composite design pattern
    14. The Command design pattern
    15. The Mediator design pattern
    16. The State design pattern
    17. The Proxy design pattern
    18. The Abstract Factory design pattern
    19. The Prototype design pattern
    20. The Bridge design pattern
    21. The Interpreter design pattern
    22. The Memento design pattern
    23. The Visitor design pattern

Tags:

Information Architecture