Re: SQL Dates in Magic 101


Tim Downie
 

Turn on the sql log in magic options settings logs , swe gateway on , put a log file name, then under second tab set sql to customer. Restart studio...run the prog....find sql statement magic generates in the log....from here paste it in ssms and work out what it needs to be. Nulls and magic can be annoying at times
From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Govert Schipper <govertschipper@...>
Sent: Friday, 20 May 2022 6:54 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] SQL Dates in Magic 101
 

What kind of database are you using?

Also check your data source settings for this column in Magic

 

Govert

 

Van: Jackson, Adam
Verzonden: vrijdag 13 mei 2022 11:52
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] SQL Dates in Magic 101

 

Hi,

 

It works in that I don’t get the Cast error but I don’t get any returned records either. I have checked the data and all records for the order I am locating have null in the Completed column.

 

Adam

 

Adam

Jackson

Senior Mgr, Operations & Digital Systems

T  +447949892482

E  adam.jackson@...

McLaren Formula 1 Team

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Govert Schipper via groups.io
Sent: 13 May 2022 09:41
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] SQL Dates in Magic 101

 

CAUTION: This email originated from outside of McLaren. Do not click links or open attachments unless you recognise the sender and know the content is safe. Report any suspicious emails using the 'Report Phishing Email' button in Outlook.

 

Adam,

 

Locating on a null() value should work.

So on both the lower and upper locate expression put an expression null()

 

Govert

 

 

Van: Jackson, Adam
Verzonden: vrijdag 13 mei 2022 10:00
Aan: magicu-l@groups.io
Onderwerp: [magicu-l] SQL Dates in Magic 101

 

Hi,

 

Probably should have worked this out ages ago but struggling with locating on null datetime fields inside a LQ or LW though I suspect would be same in main table too. I have a null allowed date field in a table. I want to locate on that column (among others) to find out if there are one more null values in that column (it’s a Date Completed column and I’m trying to find if there are any incomplete records). I have tried locating on the following and either get no records or mainly cast error; ‘00/00/0000’DATE, ‘00/00/0000’,0,null(),’’. I have also tried locating on time part of datetime pair but makes no difference. In my desperation I have changed the null allowed setting in the data repository. The only method I have got working is to add a logical virtual to the LQ initialised on Completed = ‘00/00/0000’DATE and locate on this being true.

 

I am sure there must be a simple way to do this most simple of things. Can anyone help?

 

Magic 2.5d

 

Thanks,

 

Adam

 

 

 

Adam

Jackson

Senior Mgr, Operations & Digital Systems

T  +447949892482

 

E  adam.jackson@...

McLaren Formula 1 Team

McLaren Technology Centre

Chertsey Road, Woking

Surrey, GU21 4YH, UK

mclaren.com

Facebook

Instagram

LinkedIn

Twitter

YouTube

The contents of this e-mail are confidential and for the exclusive use of the intended recipient. If you are not the intended recipient you should not read, copy, retransmit or disclose its contents. If you have received this email in error please delete it from your system immediately and notify us either by email or telephone. The views expressed in this communication may not necessarily be the views held by McLaren Racing Limited.
McLaren Racing Limited, McLaren Technology Centre, Chertsey Road, Woking, Surrey, GU21 4YH, UK. Company Number: 01517478

 

 

Join main@magicu-l.groups.io to automatically receive all group messages.