Click here to Skip to main content
15,925,371 members
Home / Discussions / Database
   

Database

 
AnswerRe: Gathering Data and Calculating??? Pin
Edbert P23-Oct-06 15:01
Edbert P23-Oct-06 15:01 
AnswerRe: Gathering Data and Calculating??? Pin
Rob Graham23-Oct-06 15:03
Rob Graham23-Oct-06 15:03 
GeneralI forgot to mention..... Pin
nit11523-Oct-06 17:01
nit11523-Oct-06 17:01 
AnswerRe: Gathering Data and Calculating??? Pin
Jerry Hammond25-Oct-06 16:50
Jerry Hammond25-Oct-06 16:50 
QuestionLooking for a good Data migration solution Pin
sludgenz23-Oct-06 12:34
sludgenz23-Oct-06 12:34 
AnswerRe: Looking for a good Data migration solution Pin
Edbert P23-Oct-06 15:03
Edbert P23-Oct-06 15:03 
GeneralRe: Looking for a good Data migration solution Pin
sludgenz23-Oct-06 15:27
sludgenz23-Oct-06 15:27 
QuestionOpen XML and DateTime [modified] Pin
GaryWoodfine 23-Oct-06 11:55
professionalGaryWoodfine 23-Oct-06 11:55 
I am getting a "Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated."

On My Sql Statement adn I can't figure out why, I have included my statement below, can anybody give me any pointers?




Declare @xmlDoc as varchar(1000)
DECLARE @DocHandle int
Declare @Loc_ORDER_REF varchar(50)
declare @loc_Order_Name varchar(50)
SET @Loc_ORDER_REF = 'Bollox'
declare @DateFormat varchar(10)

-- Get the Current Dateformat stored in l8_config
Select @DateFormat = 'dmy'--(select config_value from l8_config where config_name = 'SQLDATEFORMAT')
set dateformat @DateFormat

Set @loc_Order_Name = null

set @xmlDoc = '<Root><OPType>1</OPType><Purpose>45</ Purpose><Category>7</Category><IssueDate>23/10/2006</IssueDate><StartDate>23/10/2006</StartDate><ReviewDate>23/10/2006</ReviewDate><Brief>dzscdsxdfvszdf</Brief><IHC>1</IHC><SpecEvent>1</SpecEvent><Oedfin>6523</Oedfin><Oicfin>6523</Oicfin></Root>'

EXEC sp_xml_preparedocument @DocHandle OUTPUT, @xmlDoc
INSERT INTO OP_ORDER
(
[OP_ORDER_REF],
[OP_ORDER_NAME],
[OP_PURPOSE_ID],
[OP_CAT_ID],
[OP_ISSUE_DATE],
[OP_START_DATE],
[OP_REVIEW_DATE],
[OP_IHC_COPY],
[OP_SPEC_EVENTID],
[OP_OFF_ENT_DET_FIN],
[OP_OFF_IN_CHRG_FIN],
[OP_BRIEF_DESC],
[OP_DIV_FLAG]
)
SELECT
@Loc_ORDER_REF,@loc_Order_Name ,
Purpose,Category,
IssueDate , StartDate ,
ReviewDate ,
Case ltrim(rtrim(IHC))
when 'true' then 1
when 'false' then 0
else 0
end ,
case ltrim(rtrim( SpecEvent))
when 'true' then 1
when 'false' then 0
else 0 End , Oedfin, Oicfin, Brief, OPType

FROM OPENXML(@DocHandle, '/Root',2) WITH (Purpose int, Category int , IssueDate datetime , StartDate datetime ,
ReviewDate datetime , IHC bit, SpecEvent bit , Oedfin varchar(50), Oicfin varchar(50), Brief varchar(1000), OPType Bit )

EXEC sp_xml_removedocument @DocHandle

Select @@Identity









-- modified at 18:00 Monday 23rd October, 2006


"a fool will not learn from a wise man, but a wise man will learn from a fool"
"It is hard to fail, but it is worse never to have tried to succeed." - Theodore Roosevelt
"Success is going from failure to failure without losing your enthusiasm." - Winston Churchill

My Website || My Blogpx" targer="_blank">My Blog</a></div>
Questionhow to add row to the result query Pin
cellardoor071623-Oct-06 3:46
cellardoor071623-Oct-06 3:46 
AnswerRe: how to add row to the result query Pin
Elina Blank23-Oct-06 3:57
sitebuilderElina Blank23-Oct-06 3:57 
AnswerRe: how to add row to the result query Pin
Eric Dahlvang23-Oct-06 4:04
Eric Dahlvang23-Oct-06 4:04 
GeneralRe: how to add row to the result query Pin
cellardoor071623-Oct-06 4:37
cellardoor071623-Oct-06 4:37 
QuestionSorting In Sqlserver Reports Pin
kjosh23-Oct-06 3:43
kjosh23-Oct-06 3:43 
Questionsearching Pin
m.m._200723-Oct-06 3:33
m.m._200723-Oct-06 3:33 
AnswerRe: searching Pin
Edbert P23-Oct-06 13:02
Edbert P23-Oct-06 13:02 
Questionget the difference between two dates Pin
abdelhameed8123-Oct-06 1:19
abdelhameed8123-Oct-06 1:19 
AnswerRe: get the difference between two dates Pin
Colin Angus Mackay23-Oct-06 2:34
Colin Angus Mackay23-Oct-06 2:34 
AnswerRe: get the difference between two dates [additional] Pin
Colin Angus Mackay23-Oct-06 2:39
Colin Angus Mackay23-Oct-06 2:39 
Questionno of rows in sql stored procedure Pin
Sakshi Smriti22-Oct-06 20:11
Sakshi Smriti22-Oct-06 20:11 
AnswerRe: no of rows in sql stored procedure Pin
Edbert P22-Oct-06 21:32
Edbert P22-Oct-06 21:32 
GeneralRe: no of rows in sql stored procedure Pin
Sakshi Smriti23-Oct-06 0:04
Sakshi Smriti23-Oct-06 0:04 
QuestionSQL 2005 xml record.value function with pattern matching Pin
Omkar Ghaisas20-Oct-06 9:52
Omkar Ghaisas20-Oct-06 9:52 
Questionself join/ select question Pin
Elina Blank20-Oct-06 8:58
sitebuilderElina Blank20-Oct-06 8:58 
AnswerRe: self join/ select question Pin
Eric Dahlvang20-Oct-06 11:06
Eric Dahlvang20-Oct-06 11:06 
QuestionRe: self join/ select question Pin
Elina Blank20-Oct-06 12:03
sitebuilderElina Blank20-Oct-06 12:03 

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.