Wrox Programmer Forums
|
BOOK: Professional Microsoft SQL Server 2012 Integration Services
This is the forum to discuss the Wrox book Professional Microsoft SQL Server 2012 Integration Services by Brian Knight, Erik Veerman, Jessica M. Moss, Mike Davis, Chris Rock; ISBN: 978-1-1181-0112-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Microsoft SQL Server 2012 Integration Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2015, 05:42 AM
Registered User
 
Join Date: Aug 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Working with Expressions Chapter 6

Please can some one explain to me the meaning of quotation marks on the

data and time functions

''SELECT * FROM MYTABLE WHERE MYDATE >= ''' + ''01/31/2012'' + '' ' ''



''SELECT * FROM MYTABLE WHERE MYDATE >= ''' +
(DT_WSTR, 255)@[System::ContainerStartTime] + '' ' ''


SELECT * FROM MYTABLE WHERE MYDATE >= ''02/22/2012 2:28:40 PM'

The above statements on the quotation mark are not making sense to me despite the explanation given on the book
 
Old August 12th, 2015, 11:13 AM
Authorized User
 
Join Date: Apr 2015
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The double quotes around the date, "01/31/2012", are there simply because we are building a string, and strings are delimited by double quotes in the expression builder. The author chose to separate the date from the other parts of the string because this part might easily be replaced with a variable. We are creating a SELECT statement, and in such a statement a date is delimited by single quotes. The author chose to include these single quotes in separate string elements, i.e., the left single quote in the string with SELECT, and the right single quote in a separate string appended at the3 end of the expression. The author could just as easily have written:
Code:
"SELECT * FROM MYTABLE WHERE MYDATE='01/31/2013'"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 exercise not working HairHelmut BOOK: Beginning iOS 4 Application Development 2 March 26th, 2011 12:53 AM
Chapter 1 - Regular Expressions - Capturing Data moopy BOOK: Expert PHP and MySQL 0 February 28th, 2011 05:44 AM
Working through Chapter 1 Geoffrey Chambers BOOK: Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 ISBN: 978-0-470-12449-9 1 January 2nd, 2010 11:38 PM
Chapter 1: Greeting Not Working Joe3000 BOOK: Beginning Ruby on Rails 2 June 14th, 2007 10:54 AM
Chapter 4 Conditional Expressions Problem Jim Wile BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 June 30th, 2004 03:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.