Problem:
Date in the SQL Server database is the type of dates, that is, month-day form yyyy year MM DD day, but imported into the report into the yyyy year mm month DD Day 00:00, that is, more than 00:00
How to remove the 00:00 ...
query table settings as shown in figure: Note that date is of type date date type
The original query statement I had in the database was written like this:
Select *from checkday_info where date= @CheckDate
The result: more than 00:00
"Fa Yi"
After Baidu changed to: (Use the time to cast)
Select Remaincash,rechargecash,consumecash,cancelcash,allcash,convert (varchar), date,23) as date from Checkday_ Info where date= @CheckDate
The following is an explanation of the red font:
First parameter varchar (10): is the second parameter date to be converted to the data type
Second parameter date: The field name of the date type to convert
The third parameter 23:date the format displayed after conversion, 23 is YYYY-MM-DD format, and 10 is mm-dd-yy format
23 is just one of the conversion formats, and different numbers represent different formats.
"Law II"
Use the Mid function to intercept
Mid is a string function in Visual Basic and Microsoft Excel that intercepts a specified number of characters from a string
The mid function is defined in detail as follows:
Mid (Text,start_num,num_chars)
Parameters:
Text: A string expression from which to return a character. If text contains null, NULL is returned.
The start position of the character part that is extracted in the start_num:text. If start exceeds the number of characters in text, MID returns 0 length
Num_chars: The number of characters to return. If you omit or num_chars more than the number of characters in the text (including the character at start), all characters from the start_num to the end of the string are returned.