Click here to Skip to main content
15,885,767 members
Home / Discussions / Database
   

Database

 
QuestionRe: Pattern matching to list in sql Pin
TheFM23410-Jul-08 4:49
TheFM23410-Jul-08 4:49 
QuestionOPENXML() and performance Pin
Kjetil Svendsen9-Jul-08 22:29
Kjetil Svendsen9-Jul-08 22:29 
AnswerRe: OPENXML() and performance Pin
Ashfield10-Jul-08 1:41
Ashfield10-Jul-08 1:41 
GeneralRe: OPENXML() and performance Pin
Kjetil Svendsen10-Jul-08 2:34
Kjetil Svendsen10-Jul-08 2:34 
QuestionInternal Processor Error Pin
mehrnoosh9-Jul-08 21:58
mehrnoosh9-Jul-08 21:58 
AnswerRe: Internal Processor Error Pin
John_Adams10-Jul-08 1:34
John_Adams10-Jul-08 1:34 
GeneralRe: Internal Processor Error Pin
mehrnoosh14-Jul-08 22:17
mehrnoosh14-Jul-08 22:17 
QuestionConvert Decimal into Date Query?? Pin
obarahmeh9-Jul-08 20:30
obarahmeh9-Jul-08 20:30 
Dear All,
My application stores two date values as Decimal in the SQL server 2005, one for the 'DayTransDate' like (2008/08/09) which is stored in the Data base as a Decimal= 20080709, and the other is for 'DayTransTime' like (12:08:44) which is stored in the Data base as a Decimal= 120844.
Now, I need to read these values and compare them with some date...
I wrote a query to convert with some help from my friend, but the query did not work well because of a syntax error (Incorrect syntax near ',') which I could not figure it out. The following is the query:

SELECT * FROM MyTable
WHERE convert(datetime, cast(DayTransDate AS char(8))
+ ' ' + STUFF(STUFF(CAST(DayTransTime AS char(6), 5, 0, ':'), 3, 0, ':')))
> DATEADD(minute, -30, getdate());

First: Is the previous query have the correct functions to convert the Decimal values into date, If yes, where is the syntax error??
Second: If you know any other way to convert, please tell me how to convert from Decimal into date.

With my Best Regards to you...

Kind Regards
OBarahmeh

AnswerRe: Convert Decimal into Date Query?? Pin
Paddy Boyd9-Jul-08 20:56
Paddy Boyd9-Jul-08 20:56 
AnswerRe: Convert Decimal into Date Query?? Pin
Ashfield9-Jul-08 21:07
Ashfield9-Jul-08 21:07 
GeneralRe: Convert Decimal into Date Query?? Pin
obarahmeh9-Jul-08 22:35
obarahmeh9-Jul-08 22:35 
GeneralRe: Convert Decimal into Date Query?? [modified] Pin
Ashfield10-Jul-08 1:27
Ashfield10-Jul-08 1:27 
GeneralRe: Convert Decimal into Date Query?? Pin
obarahmeh10-Jul-08 2:02
obarahmeh10-Jul-08 2:02 
GeneralRe: Convert Decimal into Date Query?? Pin
Ashfield10-Jul-08 9:22
Ashfield10-Jul-08 9:22 
AnswerRe: Convert Decimal into Date Query?? [modified] Pin
leoinfo10-Jul-08 2:44
leoinfo10-Jul-08 2:44 
GeneralRe: Convert Decimal into Date Query?? [modified] Pin
obarahmeh12-Jul-08 21:46
obarahmeh12-Jul-08 21:46 
Questionhow to use index? very simple i want some basic information........... Pin
Shaik Haneef9-Jul-08 20:27
Shaik Haneef9-Jul-08 20:27 
AnswerRe: how to use index? very simple i want some basic information........... Pin
Paddy Boyd9-Jul-08 20:54
Paddy Boyd9-Jul-08 20:54 
AnswerRe: how to use index? very simple i want some basic information........... Pin
Ashfield9-Jul-08 21:13
Ashfield9-Jul-08 21:13 
QuestionTransaction (Process ID 156) was deadlocked on lock Pin
sujithkumarsl9-Jul-08 18:23
sujithkumarsl9-Jul-08 18:23 
AnswerRe: Transaction (Process ID 156) was deadlocked on lock Pin
Ashfield9-Jul-08 21:22
Ashfield9-Jul-08 21:22 
Questiondatabase conection_string Pin
nelsonpaixao9-Jul-08 13:56
nelsonpaixao9-Jul-08 13:56 
AnswerRe: database conection_string Pin
Paddy Boyd9-Jul-08 20:59
Paddy Boyd9-Jul-08 20:59 
AnswerRe: database conection_string Pin
Ashfield9-Jul-08 21:17
Ashfield9-Jul-08 21:17 
QuestionSQL FOR XML issue [modified] Pin
DerekFL9-Jul-08 7:59
DerekFL9-Jul-08 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.