Get month from DATETIME in sqlite
I don’t understand, the response is in your question : select strftime(‘%m’, dateField) as Month …
I don’t understand, the response is in your question : select strftime(‘%m’, dateField) as Month …
Try something like: update salereg1 set expdate = current_date + interval ‘1 month’ * numberofmonths;
There is no built-in function that counts occurences of substring in a string, but you can calculate the difference between the original string, and the same string without commas: LENGTH(fooCommaDelimColumn) – LENGTH(REPLACE(fooCommaDelimColumn, ‘,’, ”)) It was edited multiple times over the course of almost 8 years now (wow!), so for sake of clarity: the query … Read more
using isn’t designed to catch exceptions; it’s designed to give you an easy way to wrap a try/finally around an object that needs to be disposed. If you need to catch and handle exceptions then you’ll need to expand it into a full try/catch/finally or put a containing try/catch around the whole thing. To answer … Read more
UPDATE YourTable SET columnName = null WHERE YourCondition
Date now midnight time: Select DATEADD(d,0,DATEDIFF(d,0,GETDATE())) ADD 600 Minutes: Select DATEADD(mi,600,DATEDIFF(d,0,GETDATE()))
One useful trick in SQL is the ability use @var = function(…) to assign a value. If you have multiple records in your record set, your var is assigned multiple times with side-effects: declare @badStrings table (item varchar(50)) INSERT INTO @badStrings(item) SELECT ‘>’ UNION ALL SELECT ‘<‘ UNION ALL SELECT ‘(‘ UNION ALL SELECT ‘)’ … Read more
If by ‘description’ you mean ‘Description’ displayed in SQL Management Studio in design mode, here it is: select st.name [Table], sc.name [Column], sep.value [Description] from sys.tables st inner join sys.columns sc on st.object_id = sc.object_id left join sys.extended_properties sep on st.object_id = sep.major_id and sc.column_id = sep.minor_id and sep.name=”MS_Description” where st.name = @TableName and sc.name … Read more
Late entry that handles negative ISNUMERIC(zipcode + ‘.0e0’) –integer ISNUMERIC(zipcode + ‘e0’) –decimal For more see this
I’ve used Cognos Series 7, Cognos Series 8, Crystal Reports, Business Objects XI R2 WebIntelligence, Reporting Services 2000, Reporting Services 2005, and Reporting Services 2008. Here’s my feedback on what I’ve learned: Reporting Services 2008/2005/2000 PROS Cost: Cheapest enterprise business intelligence solution if you are using MS SQL Server as a back-end. You also have … Read more