Skip to main content

All Questions

0 votes
4 answers
145 views

get sql date between

I want to get data from a range of selected dates in SQL Server. This is the SQL query (SQL Server 2005) SELECT * FROM slips WHERE CONVERT(char, date_Of_Birth, 101) BETWEEN ('01/08/2019') AND ('...
fhulufhelo hanyahanya's user avatar
1 vote
1 answer
48 views

Find uncovered periods without exploding each combination

I have the following two tables People +--------+---------------+-------------+ | Name | ContractStart | ContractEnd | +--------+---------------+-------------+ | Kate | 20180101 | ...
Nicolaesse's user avatar
  • 2,707
2 votes
2 answers
109 views

Find MIN and MAX date on a discontinuous period of time YYYYMM00

I have the following two tables: DimensionTime is a table that contains every month, ordered by ID, in a YYYMM00 form LogPlayer is a table where there are some statistics related to a player and a ...
Nicolaesse's user avatar
  • 2,707
0 votes
1 answer
82 views

Calculate service date of a truck with time and service day data

We have some trucks that serve some destinations in different days. In Sql Server table, the table is like below. TruckCode ServiceHour Monday Tuesday Wednesday Thursday Friday Saturday Route1 ...
ahmet kocadogan's user avatar
1 vote
2 answers
54 views

Get date format as Test_170727_1608.txt.gpg

I am trying to send attach a file thats been created and send as an email using "exec master..sp_sendSAM" in an SSIS 2005 flow. This is what I tried 'Test_'+ convert(varchar(12), getdate(), 12)+'....
YJG's user avatar
  • 133
2 votes
2 answers
477 views

Month returns incorrect value from date

Afternoon, I have an issue with a SQL server that I could do with some help with. When I run a select statement with a date range in the where it returns rows from the wrong date range. e.g. If I ...
lardymonkey's user avatar
1 vote
2 answers
479 views

update multiple rows with random datetime sql server

I have table sql server 2005 that contains 3000 rows Like that <<ID>> <<Time>> 5620298 2015-01-05 16:00:00.000 5620299 2015-01-06 16:00:00.000 5620300 ...
Bahaa Eldin's user avatar
0 votes
1 answer
80 views

Not able to execute the stored procedure

I have table in which my date column value is saved with time also like this 2016-06-10 14:56:11.000 Now while executing my SP, I pass one parameter as date like this exec UserReportData '06-10-...
hud's user avatar
  • 4,701
1 vote
4 answers
573 views

Adding datetime as a parameter is giving Error converting data type varchar to datetime (Error) in stored procedure

I have a stored procedure which accepts one parameter as @ReportDate. but when I execute it with parameter it gives me error as Error converting data type varchar to datetime. Here is the SP. ...
hud's user avatar
  • 4,701
1 vote
3 answers
665 views

Trying to add minutes to HH:MM to 00:00 in Char(5) Field

I'm pretty new to SQL, someone has asked me for help and I'm trying to assist; I've installed SQL 2005 because this is the version they are running on. My task: They have a table called 'appTime' ...
tryingtofigurethingsout's user avatar
-1 votes
1 answer
732 views

Query Sum by Shift in SQL Server

I have 3 tables called stop, detail, and shift. I would like to do something so the result can like the image I'm having hard time doing this, please help me. I will appreciate it if you guys can ...
irvank's user avatar
  • 15
-1 votes
5 answers
4k views

get todays date with last 6 months back

I want the exact date as 22/06/2015 from the query whose Joining date should be exact 22/06/2015 which is exact 6 months back from todays date I tried like below Select date_of_joining,* ...
hud's user avatar
  • 4,701
2 votes
2 answers
1k views

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value error

I am adding a date as "09/10/2014" into the textbox and clicking the submit button but getting error as:- The conversion of a char data type to a datetime data type resulted in an out-of-range ...
hud's user avatar
  • 4,701
1 vote
2 answers
600 views

T-SQL format date by pattern

Is possible change format date by specific pattern ? I need to made a function which has a two parameters. First is date and second is pattern. I need convert more date variants. Goal this function is ...
tomas's user avatar
  • 153
0 votes
4 answers
2k views

Replace time part with custom time

I have a scenario where I have to match the system time, but I have to match the current time with a pre-set saved datetime variable in sql server. DECLARE @SyncDate AS DATETIME DECLARE @SystemDate ...
DareDevil's user avatar
  • 5,319

15 30 50 per page
1
2 3 4 5
15