Click here to Skip to main content
14,972,741 members
Home / Discussions / Database
   

Database

 
SuggestionRe: Excel Spreadsheet To Database Migration Assistance Pin
CHill607-Apr-21 0:57
mveCHill607-Apr-21 0:57 
AnswerRe: Excel Spreadsheet To Database Migration Assistance Pin
Mycroft Holmes7-Apr-21 12:54
professionalMycroft Holmes7-Apr-21 12:54 
QuestionSQLite query Pin
David Crow23-Mar-21 10:02
MemberDavid Crow23-Mar-21 10:02 
AnswerRe: SQLite query Pin
k505423-Mar-21 14:42
mvek505423-Mar-21 14:42 
GeneralRe: SQLite query Pin
David Crow23-Mar-21 16:10
MemberDavid Crow23-Mar-21 16:10 
AnswerRe: SQLite query Pin
Richard Deeming23-Mar-21 23:31
mveRichard Deeming23-Mar-21 23:31 
GeneralRe: SQLite query Pin
David Crow24-Mar-21 3:16
MemberDavid Crow24-Mar-21 3:16 
QuestionDisallowed implicit conversion from data type smalldatetime to data type float Pin
jkirkerx18-Mar-21 11:56
professionaljkirkerx18-Mar-21 11:56 
I took a PHP job, upgrading an old PHP 4.7 project to PHP 7.14. I'm doing pretty good rewriting it as an object oriented app, and re imagining the design. But I'm terrible at SQL, and glad Linq came along. I get the error message below, and played around with the statement, ruling out that the cast is the issue. I think the date I put in bold is the issue, because I removed the line and it ran fine. I get the convert part, but should I convert to a float as well? Why a float if so? Is the date really stored as numbers?
Error Message:
Array ( [0] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 260 [code] => 260 [2] => [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Disallowed implicit conversion from data type smalldatetime to data type float, table 'commission_summary', column 'startup_check_date'. Use the CONVERT function to run this query. [message] => [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Disallowed implicit conversion from data type smalldatetime to data type float, table 'commission_summary', column 'startup_check_date'. Use the CONVERT function to run this query. ) ) 

getSalesBonusByDate 362: SELECT count (a.project_no) FROM project as a, commission_summary as b WHERE a.project_no = b.project_no AND (a.sold_date <= 3-1-2021) AND (a.status = 'construction' or a.status = 'finished') AND ((CAST(FLOOR(b.startup_check_date)AS DATETIME) BETWEEN 1-1-2021 AND 3-1-2021)) AND a.sales_no = '79' 1

Query: I think the date in bold is the error, but I'm not sure what to convert the value to. The field is a smalldatetime.
SELECT count (a.project_no) FROM project as a, commission_summary as b WHERE a.project_no = b.project_no AND (a.sold_date <= 3-1-2021) AND (a.status = 'construction' or a.status = 'finished') AND ((CAST(FLOOR(b.startup_check_date)AS DATETIME) BETWEEN 1-1-2021 AND 3-1-2021)) AND a.sales_no = '79' 
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerRe: Disallowed implicit conversion from data type smalldatetime to data type float Pin
Victor Nijegorodov18-Mar-21 21:15
MemberVictor Nijegorodov18-Mar-21 21:15 
GeneralRe: Disallowed implicit conversion from data type smalldatetime to data type float Pin
jkirkerx19-Mar-21 6:58
professionaljkirkerx19-Mar-21 6:58 
GeneralRe: Disallowed implicit conversion from data type smalldatetime to data type float Pin
jsc4219-Mar-21 7:45
professionaljsc4219-Mar-21 7:45 
GeneralRe: Disallowed implicit conversion from data type smalldatetime to data type float Pin
jkirkerx19-Mar-21 8:54
professionaljkirkerx19-Mar-21 8:54 
GeneralRe: Disallowed implicit conversion from data type smalldatetime to data type float Pin
jsc4219-Mar-21 11:17
professionaljsc4219-Mar-21 11:17 
GeneralKearning Python Pin
Lumbeta Aquirok17-Mar-21 23:50
MemberLumbeta Aquirok17-Mar-21 23:50 
GeneralRe: Kearning Python Pin
Richard MacCutchan18-Mar-21 0:01
mveRichard MacCutchan18-Mar-21 0:01 
QuestionSystem.NullReferenceException: Pin
H. Martins23-Feb-21 14:28
MemberH. Martins23-Feb-21 14:28 
AnswerRe: System.NullReferenceException: Pin
Richard MacCutchan23-Feb-21 22:04
mveRichard MacCutchan23-Feb-21 22:04 
GeneralRe: System.NullReferenceException: Pin
Richard Deeming23-Feb-21 22:19
mveRichard Deeming23-Feb-21 22:19 
GeneralRe: System.NullReferenceException: Pin
Richard MacCutchan23-Feb-21 22:31
mveRichard MacCutchan23-Feb-21 22:31 
QuestionGeneral advice about simple table storage. Pin
H. Martins19-Feb-21 9:34
MemberH. Martins19-Feb-21 9:34 
AnswerRe: General advice about simple table storage. Pin
Eddy Vluggen20-Feb-21 7:04
professionalEddy Vluggen20-Feb-21 7:04 
GeneralRe: General advice about simple table storage. Pin
H. Martins21-Feb-21 3:26
MemberH. Martins21-Feb-21 3:26 
GeneralRe: General advice about simple table storage. Pin
NotTodayYo12-Mar-21 7:17
MemberNotTodayYo12-Mar-21 7:17 
GeneralRe: General advice about simple table storage. Pin
Eddy Vluggen13-Mar-21 6:09
professionalEddy Vluggen13-Mar-21 6:09 
QuestionWITSML Server And Client in C# Pin
Member 1332584614-Feb-21 21:54
MemberMember 1332584614-Feb-21 21:54 

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.