Click here to Skip to main content
15,434,219 members
Home / Discussions / Database
   

Database

 
GeneralRe: Internal Processor Error Pin
mehrnoosh14-Jul-08 22:17
Membermehrnoosh14-Jul-08 22:17 
QuestionConvert Decimal into Date Query?? Pin
obarahmeh9-Jul-08 20:30
Memberobarahmeh9-Jul-08 20:30 
AnswerRe: Convert Decimal into Date Query?? Pin
Paddy Boyd9-Jul-08 20:56
MemberPaddy Boyd9-Jul-08 20:56 
AnswerRe: Convert Decimal into Date Query?? Pin
Ashfield9-Jul-08 21:07
MemberAshfield9-Jul-08 21:07 
GeneralRe: Convert Decimal into Date Query?? Pin
obarahmeh9-Jul-08 22:35
Memberobarahmeh9-Jul-08 22:35 
GeneralRe: Convert Decimal into Date Query?? [modified] Pin
Ashfield10-Jul-08 1:27
MemberAshfield10-Jul-08 1:27 
GeneralRe: Convert Decimal into Date Query?? Pin
obarahmeh10-Jul-08 2:02
Memberobarahmeh10-Jul-08 2:02 
GeneralRe: Convert Decimal into Date Query?? Pin
Ashfield10-Jul-08 9:22
MemberAshfield10-Jul-08 9:22 
I have just been running this

CREATE TABLE  #MyTable (   DayTransDate Decimal(8,0) ,    DayTransTime  Decimal(6,0) );  
INSERT INTO #MyTable (DayTransDate, DayTransTime) SELECT 20080709, 120844 ; 
INSERT INTO #MyTable (DayTransDate, DayTransTime) SELECT 20090709, 120844 ;   
INSERT INTO #MyTable (DayTransDate, DayTransTime) SELECT 20080710, 150844 ;
INSERT INTO #MyTable (DayTransDate, DayTransTime) SELECT 20080710, 200844 ;

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


which gives me

DayTransDate DayTransTime comparedate
20090709 120844 2008-07-10 19:49:16.030
20080710 200844 2008-07-10 19:49:16.030

exactly as expected, so what doesn't work?

Bob
Ashfield Consultants Ltd

AnswerRe: Convert Decimal into Date Query?? [modified] Pin
leoinfo10-Jul-08 2:44
Memberleoinfo10-Jul-08 2:44 
GeneralRe: Convert Decimal into Date Query?? [modified] Pin
obarahmeh12-Jul-08 21:46
Memberobarahmeh12-Jul-08 21:46 
Questionhow to use index? very simple i want some basic information........... Pin
Shaik Haneef9-Jul-08 20:27
MemberShaik Haneef9-Jul-08 20:27 
AnswerRe: how to use index? very simple i want some basic information........... Pin
Paddy Boyd9-Jul-08 20:54
MemberPaddy Boyd9-Jul-08 20:54 
AnswerRe: how to use index? very simple i want some basic information........... Pin
Ashfield9-Jul-08 21:13
MemberAshfield9-Jul-08 21:13 
QuestionTransaction (Process ID 156) was deadlocked on lock Pin
sujithkumarsl9-Jul-08 18:23
Membersujithkumarsl9-Jul-08 18:23 
AnswerRe: Transaction (Process ID 156) was deadlocked on lock Pin
Ashfield9-Jul-08 21:22
MemberAshfield9-Jul-08 21:22 
Questiondatabase conection_string Pin
nelsonpaixao9-Jul-08 13:56
Membernelsonpaixao9-Jul-08 13:56 
AnswerRe: database conection_string Pin
Paddy Boyd9-Jul-08 20:59
MemberPaddy Boyd9-Jul-08 20:59 
AnswerRe: database conection_string Pin
Ashfield9-Jul-08 21:17
MemberAshfield9-Jul-08 21:17 
QuestionSQL FOR XML issue [modified] Pin
DerekFL9-Jul-08 7:59
MemberDerekFL9-Jul-08 7:59 
AnswerRe: SQL FOR XML issue Pin
leoinfo9-Jul-08 9:26
Memberleoinfo9-Jul-08 9:26 
QuestionDataTable validation event Pin
benallen0029-Jul-08 7:54
Memberbenallen0029-Jul-08 7:54 
AnswerRe: DataTable validation event Pin
DerekFL9-Jul-08 8:05
MemberDerekFL9-Jul-08 8:05 
QuestionGetting the value of a primary key that is an Identity field Pin
LongRange.Shooter9-Jul-08 6:26
MemberLongRange.Shooter9-Jul-08 6:26 
AnswerRe: Getting the value of a primary key that is an Identity field Pin
leoinfo9-Jul-08 6:56
Memberleoinfo9-Jul-08 6:56 
QuestionCan't find SSIS or SSRS Pin
meeram3959-Jul-08 0:12
Membermeeram3959-Jul-08 0:12 

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.