Search
-
Category: (Transact SQL)
What? A very quick note in case I forget this one. If you are trying to join two tables and receiving the error "Conversion failed when converting the varchar value 'B110' to data type int" then read ...Created on 14 May 2013 -
Category: (MS Integration Services)
... conversion working in an SSIS package which read from a text file. Note that the example below converts a string in European Date Format (ie. "ddmmyyyy" to "dd/mm/yyyy"). Also, my data flow imports two ...Created on 14 March 2013 -
Category: (PHP)
... comment if they do not: Surround string (apostrophes) with red styling Convert: this='a string' » this='a string' $string_formatted = preg_replace ( '/\'([^\']+)\'/', '<span ...Created on 07 February 2013 -
Category: (SQL)
... '%d/%m/%Y') CONVERT(varchar, getdate(), 103) Time to Seconds TIME_TO_SEC(now()) (DATEPART(hour, getdate()) * 3600) + (DATEPART(minute, getdate()) * 60) + (DATEPART(second, getdate())) Seconds to ...Created on 31 January 2013 -
Category: (PHP)
What? Just a quick note on how to format a given filesize and to reduce the display output to a small string, eg: 196 bytes : displays as => "196 bytes" 12945 bytes : displays ...Created on 03 January 2013 -
Category: (Transact SQL)
... 1, 0, REPLICATE('0', 3 - LEN(@RandMSeconds))); SET @TimeVal = CONVERT(time, @TimeVal, 14); END -- DETERMINE WHICH DATE PARTS WERE SUBMITTED ...Created on 07 December 2012 -
Category: (Transact SQL)
... = 0 BEGIN -- OPEN RandomID SET @random = CEILING(RAND()* CONVERT(VARCHAR(MAX),@NumberLeft) ) SELECT @ChosenID = MAX(ID ) FROM (SELECT TOP ...Created on 07 December 2012 -
Category: (Transact SQL)
... @myXml = CONVERT(xml,'<root><s>' + REPLACE(@p_SearchColumns,',','</s><s>') + '</s></root>'); DECLARE Cursor1 CURSOR FOR SELECT [Value] = T.c.value('.','varchar(max)') ...Created on 26 October 2012 -
Category: (Transact SQL)
What? This is a quick note to show you how to convert a given comma delimited string into a database table: Given: "Title,Forenames,Surname" Return: ID Value ------ ---------------- ...Created on 26 October 2012 -
Category: (Transact SQL)
... 1, 0, REPLICATE('0', 3 - LEN(@RandMSeconds))); SET @TimeVal = CONVERT(time, @TimeVal, 14); END -- DETERMINE WHICH DATE PARTS WERE SUBMITTED ...Created on 01 August 2012 -
Category: (MySQL)
... ...do some more here ???... } } Yields -- Note this data matches the brief as we've converted the seconds to time. -- Using MySQL to convert rather than PHP so as not to ...Created on 27 April 2012 -
Category: (PHP)
... to properly convert seconds into total hours, minutes and seconds (taking into account regional settings and without using a date function). How? $total_time =intval(intval($total_seconds)/ 3600).":"; $total_time.=str_pad(intval(($total_seconds/60)%60),2,"0",STR_PAD_LEFT).":"; $total_time.=str_pad(intval($total_seconds%60),2,"0",STR_PAD_LEFT); // ...Created on 31 January 2012 -
Category: (MySQL)
... this is interpreted as a string and when converted to a number only retrieves the first value before the first comma. Consider the following, the first query is how MySQL interprets the query and the ...Created on 02 January 2012 -
Category: (MS Reporting Services)
... = 2 UNION ALL SELECT TOP 1 '<Select a Value>' AS Name, CONVERT(uniqueidentifier,'00000000-0000-0000-0000-000000000000') AS ItemID FROM ExecutionLogStorage ) AS d1 ORDER ...Created on 14 December 2011 -
Category: (MS Reporting Services)
... AS 'Phone', tt.[SiteId] AS 'Site', wm.[WeekNumber] AS FacilityWeek, CONVERT(CHAR(10), GETDATE(), 103) AS 'WeekStart', CONVERT(CHAR(10), DATEADD(day, 6, GETDATE()), 103) AS 'WeekEnd', SD.[SetId] ...Created on 11 October 2011 -
Category: (WordPress)
This is for Joomla 1.5.x sites! Note that this article is for Joomla 1.5.x sites to be converted to Wordpress 3.2.x sites. I started with a Joomla 1.5 as the move from Joomla 1.6 or greater is a lot ...Created on 03 October 2011 -
Category: (AutoHotkey)
These are for autohotkey and in AHK code. Taken from Autohotkey forums topic 1878: From Hexadecimal to RGB From RGB to Hexadecimal Check for a valid hexadecimal value From Hexadecimal ...Created on 27 September 2011 -
Category: (MediaWiki)
... PageID, CONVERT(p.page_title USING latin1) AS PageTitle, CONVERT(t.old_text USING latin1) AS PageContent, (SELECT GROUP_CONCAT(CONVERT(wikimedia_categorylinks.cl_to USING latin1)) FROM wikimedia_categorylinks ...Created on 22 September 2011 -
Category: (AutoHotkey)
As you can tell these are my messed up functions that convert dates into seconds and vice-versa. They're a little disorganised but they're the ones I copy and paste to my scripts then modify. In ...Created on 20 September 2011 -
Category: (Oracle SQL)
Just a quick note as to something that worked for me. Taken from the Oracle forums @ https://forums.oracle.com/forums/thread.jspa?messageID=6861756 Situation I have one column of values that I've ...Created on 30 August 2011