I need the datetime to be in the following format for SQL server 2005
dd/MM/YYYY HH:MI in 24 Hour Format
note: seconds are not included
Thanks for any help in advance
View Complete Post
Have spent few hours to get this working. I like to get help now. Please note MONTH AND DATES stored in single or double digits as they occur.
Unfortunately DATE TIME is stored in NVARCHAR Data type column as 2/9/2010, 22/10/2010 etc. Following UK Date here.
It is required to pull the data to COUNT No. of Expired. Obviously below one fails.
--AS Date AND Month stored in Single digits AND double digits , below statement
--thorws Arthmetic overflow exception
SUM(CASE WHEN CONVERT(DATETIME,ExpiryDate,103) >= (CONVERT(datetime,'2010-01-07',103)) AND
CONVERT(DATETIME,ExpiryDate,103) < dateadd(month,1,(convert(datetime,'2010-01-09', 103))) THEN 1 ELSE 0 END) AS Expired
ExpiryDate column in Table Data Type is NVARCHAR , storing Dates ONLY without time as 2/10/2010 , 12/10/2010 IN DD/MM/YYYY FORMAT.
NOW IT IS REQUIERD TO RETRIEVE ALL RECORDS WHERE EXPIRYDATE BETWEEN USER PASSED START MONTH,START YEAR AND END MONTH, END YEAR.
USING SQL SERVER 2000
SUM(CASE WHEN CONVERT(datetime,a.expirydate,103) >= (CONVERT(datetime,'2010-01-07',103)) AND
CONVERT(DATETIME,a.ExpiryDate,103) < dateadd(month,1,(convert(datetime,'2010-01-09', 103))) THEN 1 ELSE 0 END) AS Expired
Your help is greatly appreciated. Spent hours to get this resolved.
FROM USER INTERFACE END USER SELECTS START MONTH, START YEAR AND END MONTH, END YEAR. IT IS REQUIRED TO RETRIEVE DATA WHERE ONE OF THE FIELDS I.E, ExpiryDate is of type NVARCHAR, stored dates as 2/10/2010 [DD/MM/YYYY] , 10/10/2010 ETC.
Using SQL Server 2000.
ALTER PROCEDURE [dbo].[CountUsers]
@startMonth nvarchar(20) = NULL,
@startYear nvarchar(20) = NULL,
@endMonth nvarchar(20) = NULL,
@endYear nvarchar(20) = NULL,
@startDate nvarchar(50) = NULL,
@endDate nvarchar(50) = NULL
SET @startDate = @startYear + '-01-' + @startMonth;
SET @endDate = @endYear + '-01-' +
I'd like to have the date and time from server.
DateTime.Now Is ok?
Must be something else?
Now you can perform efficient, sophisticated text analysis using regular expressions in SQL Server 2005.
MSDN Magazine February 2007
What if you need to convert an existing Microsoft Access 97 database application into a true client-server application that is based on a SQL Server back end? If you know a little about Visual Basic and SQL Server, it's easy to make your app take advantage of the power and scalability provided by SQL Server 7.0. Using some concrete code examples, this article takes you step by step through converting the native Jet queries in your Access application into stored procedures and pass-through queries that SQL Server can use. You'll also learn how to pass on parameters when your client-server app calls these SQL Server stored procedures and queries.
MSDN Magazine June 2000
How do you write a date value to an XMLElement in .NET 3.5 XMLDocument object.
I am using the following:
DateTime orderDate = new DateTime();orderDate = DateTime.Now; // 2010-08-24 16:45:46
string st = XmlConvert.ToString(orderDate, "yyyy-MM-dd"); // st="2010-08-24"DateTime dt2 = XmlConvert.ToDateTime (st, "yyyy-MM-dd"); // dt2 = "2010-08-24 00:00:00"
I would like to remove the time section "00:00:00". I only need to write a date in the XML file with the following format :
Order date is defined like this in the xsd file : <xs:element name="OrderDate" type="xs:date"/>
Thanks for your support.
i don't know nothing to ASP and i need your help to convert the following code to ASP.NET
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "https://api.c4sms.com/?" & strQueryString, false
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
I need help for this.
Thank you very much.
If you known the full code is:
'Replace values with your C4 username and password
CONST c4USERNAME = "Your C4 Username Here"
CONST c4PASSWORD = "Your C4 Password Here"
'Function to send the SMS message
'Create new variables
Dim strQueryString 'Holds data to post to C4 website
Dim objHttp 'The XMLHTTP object to make the post request
Dim strResponseTxt 'The response from the C4 server
'Build the query string
strQueryString = "username=" & c4USERNAME & "&password=" & c4PASSWORD & "&send