<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>How To Solutions &#187; SQL</title>
	<atom:link href="http://how-to-solutions.com/category/sql/feed" rel="self" type="application/rss+xml" />
	<link>http://how-to-solutions.com</link>
	<description>Giving You Computer Solutions</description>
	<lastBuildDate>Wed, 25 Nov 2009 10:35:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQL Week by Week</title>
		<link>http://how-to-solutions.com/sql-week-by-week.html</link>
		<comments>http://how-to-solutions.com/sql-week-by-week.html#comments</comments>
		<pubDate>Fri, 26 Sep 2008 23:33:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[week]]></category>

		<guid isPermaLink="false">http://how-to-solutions.com/?p=30</guid>
		<description><![CDATA[This handy little SQL select statement was given to me by one of the developers I work with. It&#8217;s used to look at a date column in a SQL table and see how many rows fall within a given week from the earliest entry. For instance you could see how many subscriptions you have week [...]]]></description>
			<content:encoded><![CDATA[<p>This handy little SQL select statement was given to me by one of the developers I work with. It&#8217;s used to look at a date column in a SQL table and see how many rows fall within a given week from the earliest entry. For instance you could see how many subscriptions you have week by week which in turn could be used to assess the quality of your marketing methods. Let&#8217;s use that premise for the example.</p>
<p>So the SQL table name is <strong>subscribe</strong> and the column will be <strong>dateAdded</strong></p>
<table border="0" bgcolor="#c0c0c0">
<tbody>
<tr>
<td>select convert(datetime, convert(varchar(25), dateadd(day, 1-datepart<br />
(weekday, dateadded),dateadded),107)),count(*)<br />
from subscribe<br />
group by convert(datetime, convert(varchar(25), dateadd(day, 1-datepart<br />
(weekday, dateadded),dateadded),107))<br />
order by 1</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="line-height: normal;">
<p>So this SQL statement should deliver something like this&#8230;</p>
<table border="0">
<tbody>
<tr>
<td width="80">6/9/2008</td>
<td>5</td>
</tr>
<tr>
<td>13/9/2008</td>
<td>6</td>
</tr>
<tr>
<td>20/9/2008</td>
<td>9</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="line-height: normal;">
<p>This little statement assumes Sunday is the first day of the week but this can be remedied (I&#8217;ve been informed).</p>
<p>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822/US/supebook-20/8001/055b5675-34ea-46eb-a29b-7419d6ff8f81"> </SCRIPT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822%2FUS%2Fsupebook-20%2F8001%2F055b5675-34ea-46eb-a29b-7419d6ff8f81&#038;Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT></p>
]]></content:encoded>
			<wfw:commentRss>http://how-to-solutions.com/sql-week-by-week.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to replace a comma with space in SQL</title>
		<link>http://how-to-solutions.com/replace-comma-with-space-sql.html</link>
		<comments>http://how-to-solutions.com/replace-comma-with-space-sql.html#comments</comments>
		<pubDate>Thu, 25 Sep 2008 23:11:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://how-to-solutions.com/?p=32</guid>
		<description><![CDATA[Background
I came across this issue when dumping the contents of a table into a CSV file from Enterprise Manager. Many people put comma&#8217;s into fields when typing their own address or something similar. This means when the CSV is opened many rows of data will be erroneous. So the solution is to replace any comma [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Background</strong></p>
<p>I came across this issue when dumping the contents of a table into a CSV file from Enterprise Manager. Many people put comma&#8217;s into fields when typing their own address or something similar. This means when the CSV is opened many rows of data will be erroneous. So the solution is to replace any comma with a space so the contents of that field are still readable.</p>
<p><strong>Solution</strong></p>
<p>Replace(table.field, &#8216;,&#8217;, &#8216; &#8216;)</p>
<p><strong>*</strong>Replace the &#8220;table.field&#8221; with the applicable table name and field name</p>
<p>This simple bit of code fixes the comma issue and will allow the table to be dumped into a CSV for further manipulation.</p>
<h3>So that&#8217;s how to replace a comma with a space in SQL</h3>
<p>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822/US/supebook-20/8001/055b5675-34ea-46eb-a29b-7419d6ff8f81"> </SCRIPT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822%2FUS%2Fsupebook-20%2F8001%2F055b5675-34ea-46eb-a29b-7419d6ff8f81&#038;Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT></p>
]]></content:encoded>
			<wfw:commentRss>http://how-to-solutions.com/replace-comma-with-space-sql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
