Getting Syntax error converting datetime from character string when doing: SET @SQL=' CONVERT(DateTime,"'+@v_excldate +'") AS DD'
@v_excldate is set to 2006-01-01 00:00:00.000
full code below. Appreciate any help.
declare @SQL VARCHAR(8000)
DECLARE @v_excldate DATETIME
set @v_excldate=...
Can I link tables using a variable? (in example below @polvar ) The variable corresponds to a column table. The above code doesn't work
select *
FROM PolicyType PolicyType_1 INNER JOIN
PROSP ON PolicyType_1.TYPE = @polvar LEFT OUTER JOIN...
How do I dynamically change one column value in the source when doing an insert?
The column TYPE0 has 5 different COLUMN names, TYPE1, TYPE2, TYPE3, TYPE4 and TYPE5, and thus I need to loop the insert statement 5 times) and change the source each time.
INSERT INTO dbo.OpDetails
(ACCREC...
When interserting date and time from an ASP page using Recordset.Update commanded, into a SQL database, the seconds are missing. It is working, if I do the same insert directly from SQL, but not from the ASP page. The seconds are missing so instead of 3:15:22 PM, 3:15:00 PM is being inserted...
When I insert this value 5/22/2007 2:28:04 into a datetime field, the seconds are "missing". Instead of 2:28:04, I end up with 2:28:00 being recorded to the SQL table. Any ideas?
How would I select the ID of the latest modified record? I have tried max(OPMarketing.MID), but that just gives me the latest ID (MID) and not the ID of the latest modified record. Select TOP 1 will not working as I am looking for multiple rows (grouped by BCOID. Any help would be appreciated...
How do I select the latest quote value for each opportunity group (GROUPOPID)? The statement below just list all the quotes and not the latest for each groupopid. If I do MAX(QUOTE) I just sent get the maximum value and not the latest quote (which might be less than the maximum). I appreciate...
I am having a problem passing a variable into an IN statement, such as WHERE convert(nvarchar(3),opid) in ( @param10). Any help would be appreciated?
declare @param1 DATETIME, @param2 VARCHAR(3), @param4 VARCHAR(4000), @param5 MONEY, @param6 VARCHAR(50), @param7 VARCHAR(20), @param8...
I know this is probably simple, but the query below may produce multiple rows of data (unless it is grouped). How do I get the result to be one row as one string, for example rowa.wordstring +rowb.wordstring + rowc.wordstring
SELECT OppName
FROM OpInfo
WHERE (GROUPOPID = 129)
I need to get the results of the query below into one record (and not multiple rows). The query below produces the following rows/results:
1
2
4
5
8
Using a SQL select statement, can I get the result to be '1, 2, 4, 5, 8' I will not ahead of time how many records or what is the range, but we...
Trying to upgrade from Sharepoint Team Services 2.0 to version 3.0, but getting this error when running the configuration wizard in the EventViewer:
Unknown SQL Exception 15363 occurred. Additional error information from SQL Server is included below.
The role 'WSS_Content_Application_Pools'...
Getting this error Method 'Microsoft.VisualBasic.Strings.Replace' not found.
in Visual Studio 2005 at compile time.
for this line: propfiles3 = Microsoft.VisualBasic.Strings.Replace(propfiles3, ".dot", "")
Have tried with and without: Imports Microsoft.VisualBasic
After converting from Visual Studio 2003 to 2005, I am getting this error/warning which prevents me from seeing the design view. Any help would be appreciated?
The variable 'propfiles' is either undeclared or was never assigned. C:\ProposalGenerator2\ProposalGenerator\Form27.vb 1107 0...
After converting from Visual Studio 2003 to 2005, I am getting this error/warning which prevents me from seeing the design view. Any help would be appreciated?
The variable 'propfiles' is either undeclared or was never assigned. C:\ProposalGenerator2\ProposalGenerator\Form27.vb 1107 0...
I am new to XML, and I can't this to work. I am getting no action (no data when I view this page on a webbrowser).
<?xml version="1.0"?><!-- DWXMLSource="http://www.weather.gov/alerts/wwarssget.php?zone=NYZ070" -->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
I have this Store Procedure that inserts records into my CSRProg table. I added a line to prevent that an existing record is being added: if not exists (select * from CSRPRog where pol_idx=@param2 and exp=@param4)
However, if I try simulate trying to add the same record twice on after on...
How would I insert multiple records from one table into one field/column into another table. When I ran the query below I am only get the first value inserted and not all of them
update roundingtype
set pccodes = pccodes+' '+ a.type from (
SELECT top 500 TYPE
FROM POLICY
WHERE...
How would I join two tables, using CROSS JOIN, or another method, if one table might have no rows (it could have rows, but it could also have no rows). There is no common identifier, so CROSS JOIN is the only alternative as I can see it. However, if one table has no data (no rows), the statement...
How do I set the REWR column below with a "case else" statement as opposed to running two different SQL update statements just to set something either 'Y' or 'N' ??
UPDATE POLICY
SET REWR='Y'
WHERE (EXISTS (SELECT 'x'
FROM POLICY B INNER JOIN...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.