|
|
Where are you using the result:
storing it in the database - do NOT format the data
displaying it in a UI - the UI needs to do the formatting
using it in a report - the report needs to do the formatting
exporting it to a file - this is the ONLY scenario where you should convert the datetime to a string (varchar) convert(varchar(20),DateValue,103) is an example.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I only Want to get Yesterday data from Oracle store in the SQL database.So that why I want to get exacly date to compare with the date in the SQL Database.
|
|
|
|
|
If Oracle has a DATE type (no time component) then in your query convert the datetime to date and filter the incoming values. Other wise use a range of datetime to determine the date you need > '2016-4-1 11:59:59' and < '2016-4-3 00:00:01'
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Now I Use T-SQL
select
Moto.ne_code,
Moto.sta_datetime,
convert(varchar(10),sta_datetime,111) as Sdate,
convert(time,sta_datetime) as S_Time,
Moto.province_id,
Moto.ne_id,
bss_cssr cssrv1,
tchtc traffic,
cssr cssrv2,
hosr_v2 hosrv2,
dropc dcr,
dcr_v2 dcrv2,
cavl calvol,
hansr hosr,
tchblor tchblr,
sdcchbr sdcchblkr
from OracleDBLink
where
convert(varchar(10),sta_datetime,111) = CONVERT(varchar(10), getdate()-1,111)
and ((bss_cssr <=95) or (dropc>=3) or (hansr<=95)) and cavl>=50
it seem to be OK get the result as I Want.
But I can Put it in the View.
I Want to creat a job to do it everytime
|
|
|
|
|
Oracle has two major temporal types, Date and Timestamp, where Timestamp has higher precision but less functionality.
The easiest way to get a date without the time component is Trunc(MyDate)
|
|
|
|
|
Hi,
I have below date text and I want to know how can I convert it to valid MySQL datetime which is yyyy-mm-dd HH:mm
Nov 20 2015 10:51AM
Nov 20 2015 10:16PM
Nov 20 2015 10:01AM
Nov 20 2015 8:43PM
Nov 20 2015 8:04PM
Nov 20 2015 5:49PM
Nov 20 2015 5:38PM
Nov 20 2015 5:23PM
Nov 20 2015 5:03PM
Nov 20 2015 4:57PM
Nov 20 2015 2:10PM
Nov 20 2015 1:51PM
Nov 19 2015 12:24AM
Nov 19 2015 11:56AM
Nov 19 2015 11:32PM
Nov 19 2015 11:27PM
Nov 19 2015 10:15AM
Nov 19 2015 10:12PM
How can I do this please?
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
This should work:
SELECT DATE_FORMAT(STR_TO_DATE('Nov 20 2015 10:51AM', '%b %d %Y %h:%i%p'), '%Y-%m-%d %H:%i'); #Returns 2015-11-20 10:51
SELECT DATE_FORMAT(STR_TO_DATE('Nov 20 2015 8:43PM', '%b %d %Y %h:%i%p'), '%Y-%m-%d %H:%i'); #Returns 2015-11-20 20:43
-NP
Never underestimate the creativity of the end-user.
|
|
|
|
|
Wow doesn't MySQL have the convert function?
SELECT CONVERT(DATETIME,'Nov 20 2015 8:43PM')
Is the SQL Server method, so simples!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It does have a CONVERT method but it won't work with that format of text dates. That was the first thing I tried.
-NP
Never underestimate the creativity of the end-user.
|
|
|
|
|
I just got handed a challange:
Create a program to knead stellar data into something visual.
I know this is redundant, as the tools already exist, but I'm between jobs and need something to do.
So I have access to the data, which is a HUGE csv file. said CSV dataset keeps crashing, excel and access, so I need some local, "portable"/deployable and free database technology. Since I want some scalability, and decleared datatypes, using a CSV file isn't feasable.
My first thought is a sql server, but they're not real user friendly if I want to distribute the software.
Anyone have any suggestions?
Please explain the benefits of the technology and not just name thibgs
Thanks!
|
|
|
|
|
How big is this file?
Both in bytes and in rows.
|
|
|
|
|
|
|
Apparently it's not the case (or not yet?) but I was under the impression that SQL Compact was deprecated. Did MS change their mind or am I confusing it with something "similar"?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I don't know, I have not used it recently.
|
|
|
|
|
(Almost) Any database can handle that.
Take a look at SQLite[^] for minimal installation and configuration.
Or SQL Server Compact edition as already mentioned, if you want to be able to upgrade to a larger version later on.
There are several inbetween versions of SQL-Server, there's an ok overview here[^]
|
|
|
|
|
A lot depends on what you are going to do with the data.
If you are going to be reading, inserting, updating and deleting then a database is the way to go - SQLite is a good choice.
If all you need to do is read a large amount of data into an application and never need to update this data then you could consider Serialising your classes(or collections of classes). This is what I have done for a calorie counting application and a visual screening application that I wrote(even if you are applying updates serialisation is still worth considering).
The nice bit about serialisation into XML is that you can look at your data with something like Notepad++ and make changes manually where necessary.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Ilove XML, but 300'000 rows, in a single file, times out the application
|
|
|
|
|
Sure 300,000 rows is probably going to stretch things a bit.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I suggest System.Data.SQLite: Downloads Page[^]. It is up to date, easy to use from c#, there is no service needed and it has very fast inserts and retrievals into/from tables. Last August I tested it by inserting up to 100 million of simple unique records on a Win 7 Pro with 4 GB of RAM and I could retrieve data in milliseconds, even from a table of 100 million... which I found quite impressive. When inserting I used parametrized queries. For fast retrieval an index needs to be created on a table column using SQL. Of course it depends on how complex is your data.
I hope this helps...
|
|
|
|
|
SQL Server has a localdb version which seems to be the replacement for the compact edition.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Hi,
I trying to learn cubes and deploy to analysis services.
I am using sql server express with advance tools, but i can not deploy the cube.
Please can some one assist me.
Thanks,
|
|
|
|
|
|
The concept:
An Information System is a system, automated or manual, that include people, machines and/or organized methods for collect, process, transmit data that represent information.
(It is my translation from Spanish to English -with a little help of google translator-).
I will like to know if I understand well the concept. I'm going to type a real example:
Hairdresser appointment:
To take an appointment there, you have to go to the hairdresser and say it to the haircutter. Then he write in his diary (physical) the date.
NOTE: there are not any technologies, all is MANUAL.
QUESTIONS: Is it an Information System?
I think that could be, because include an elements set (people -customer and haircutter- and organized methods -diary-) for collect, process, transmit data that represent information (the haircutter COLLECT the customer's date in his diary, he check if the date is unoccupied -PROCESS- and finally he TRANSMIT THE DATA that represent information to the customer, for example "Ok, remember you have appointment to the hairdresser X date").
Am I understanding well the concept?
|
|
|
|