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...
I am inserting the value from an ASP page, so I guess it is an ASP question. The field is datetime and not smalltime. It works in SQL, but not when I insert from an ASP page.
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...
How can I modify the above example so it returns two values in a table, the 2nd value being row identifier. I need to tie the output of the function to another table and I don't see how I can do it without the row identifier (the ID).
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'...
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.