Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Wednesday, March 28, 2012

put delimited data in unconventional format in dataset

hi,

Im interfacing with an app that imports/exports data in a very specific hash-delimited format
like this:

#column1=Value1#column2=Value2#column3=Value3 etc.

How do i import this into a dataset so i can in my db.

Obviously ideal way would be to use the Jet text provider, but im not sure if the schema.ini can be setup to deal with this kind of data.

If anyone has ANY way of me getting this data into dataset please help.Have you can access to SQL DTS?

Friday, March 23, 2012

purpose of writing dates in this format

hi Experts,
what is the purpose writing a date in the following format:

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'

what benifit does it add to later form of writing?
Thanks in advance.
schal.On 15.01.2007 16:34, schal wrote:

Quote:

Originally Posted by

hi Experts,
what is the purpose writing a date in the following format:
>
where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'
>
what benifit does it add to later form of writing?


It's JDBC / ODBC escape syntax for timestamps.

http://java.sun.com/j2se/1.4.2/docs...ent.html#999472
http://support.microsoft.com/?scid=...142930&x=9&y=15
The former is converted by the ODBC / JDBC driver to some DB specific
binary representation of a timestamp while the latter undergoes
conversion in the DB. I'd generally use the escape syntax as it is more
portable and not affected by session parameters that affect date formatting.

Kind regards

robert|||schal (shivaramchalla@.gmail.com) writes:

Quote:

Originally Posted by

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'
>
what benifit does it add to later form of writing?


In addition to Robert's post, Tibor Karaszi's article on date format gives
some more information:
http://www.karaszi.com/SQLServer/info_datetime.asp.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||robert
Thank you very much for clearing that
Erland
thanks for refering me to the article
the tips are very imformative and helpful
__

Erland Sommarskog wrote:

Quote:

Originally Posted by

schal (shivaramchalla@.gmail.com) writes:

Quote:

Originally Posted by

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'

what benifit does it add to later form of writing?


>
In addition to Robert's post, Tibor Karaszi's article on date format gives
some more information:
http://www.karaszi.com/SQLServer/info_datetime.asp.
>
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

|||Robert,
Thank you very much for clearing that
Erland,
thanks for refering me to the article
the tips are very imformative and helpful
__

Erland Sommarskog wrote:

Quote:

Originally Posted by

schal (shivaramchalla@.gmail.com) writes:

Quote:

Originally Posted by

where x.event_date >= {ts '1980-01-01 00:00:00'}
versus like this:
where x.event_date >= '1980-01-01 00:00:00'

what benifit does it add to later form of writing?


>
In addition to Robert's post, Tibor Karaszi's article on date format gives
some more information:
http://www.karaszi.com/SQLServer/info_datetime.asp.
>
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

sql

Wednesday, March 21, 2012

purchase order query: very funny and challenge ^_^

i query a purchase order table, there is one column called PO_No, format: LP-0245111-0004

i make following statement to query: the middle code act as my id, using it search my records, the last 4 digit used to find the last purchase order number

SqlSelectCommand2.CommandText = "SELECT PO_No FROM [PURCHASE ORDER] WHERE PO_No Like '%" & GetYearCode() & "%' ORDER BY Right(PO_No, 4) DESC"

i checked my database, last record is LP-0545381-0300

in my debuging process, surprisingly found that selected record is LP-0545381-301 !

any one hav any suggestion? ^_^

I fail to see the humor here, but that's irrelevant. It's difficult to know the query behavior without knowing what GetYearCode() is supposed to return and how it relates to the data in your table. Also, why does your last record (LP-0545381-301) have only 3 digits at the end when your format suggests that it should contain 4 digits? Finally, what were you expecting the result to be?|||

database never had that record, but selected out, isnt it very funny...anyway, GetYearCode() will return the middle code as0545381, i also suprisingly why return 3 digit?!unreasonable, isnt it

what i expected result isLP-0545381-0300

Tuesday, March 20, 2012

Pulling Data from more than one UNLINKED table

I am new to this so hopefully you'll bare with me if this is a stupid
question.
I receive data in a dbf format from the state office on a yearly basis. I
have figured out how to use SSIS to pull these into the SQL system as
different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
The state has a habit of changing the fields names from year to year, and
what I would like to do is build standard queries that compares one year to
the next. Since I cannot link this data (it is prenatal birth data) on any
field because there is no like field from one year to the next, what would a
query look like, say, to compare birth_hospital in 2002, 2003, and 2004.
I have three separate Select statements that pulls and groups the data, but
they are feeding into separate panes (one for each year). How do I get them
in one pane side-by-side?
TIA
Any help is appreciated.
SELECT birth_date, birth_hospital
FROM Birth2002
UNION
SELECT BirthDate, BirthHospital
FROM Birth2003
UNION
SELECT Bdte, BHosp
FROM Birth2004
"JC HARRIS" wrote:

> I am new to this so hopefully you'll bare with me if this is a stupid
> question.
> I receive data in a dbf format from the state office on a yearly basis. I
> have figured out how to use SSIS to pull these into the SQL system as
> different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
> The state has a habit of changing the fields names from year to year, and
> what I would like to do is build standard queries that compares one year to
> the next. Since I cannot link this data (it is prenatal birth data) on any
> field because there is no like field from one year to the next, what would a
> query look like, say, to compare birth_hospital in 2002, 2003, and 2004.
> I have three separate Select statements that pulls and groups the data, but
> they are feeding into separate panes (one for each year). How do I get them
> in one pane side-by-side?
> TIA
> Any help is appreciated.
>
>

Pulling Data from more than one UNLINKED table

I am new to this so hopefully you'll bare with me if this is a stupid
question.
I receive data in a dbf format from the state office on a yearly basis. I
have figured out how to use SSIS to pull these into the SQL system as
different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
The state has a habit of changing the fields names from year to year, and
what I would like to do is build standard queries that compares one year to
the next. Since I cannot link this data (it is prenatal birth data) on any
field because there is no like field from one year to the next, what would a
query look like, say, to compare birth_hospital in 2002, 2003, and 2004.
I have three separate Select statements that pulls and groups the data, but
they are feeding into separate panes (one for each year). How do I get them
in one pane side-by-side?
TIA
Any help is appreciated.SELECT birth_date, birth_hospital
FROM Birth2002
UNION
SELECT BirthDate, BirthHospital
FROM Birth2003
UNION
SELECT Bdte, BHosp
FROM Birth2004
"JC HARRIS" wrote:

> I am new to this so hopefully you'll bare with me if this is a stupid
> question.
> I receive data in a dbf format from the state office on a yearly basis. I
> have figured out how to use SSIS to pull these into the SQL system as
> different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
> The state has a habit of changing the fields names from year to year, and
> what I would like to do is build standard queries that compares one year t
o
> the next. Since I cannot link this data (it is prenatal birth data) on any
> field because there is no like field from one year to the next, what would
a
> query look like, say, to compare birth_hospital in 2002, 2003, and 2004.
> I have three separate Select statements that pulls and groups the data, bu
t
> they are feeding into separate panes (one for each year). How do I get the
m
> in one pane side-by-side?
> TIA
> Any help is appreciated.
>
>

Pulling Data from more than one UNLINKED table

I am new to this so hopefully you'll bare with me if this is a stupid
question.
I receive data in a dbf format from the state office on a yearly basis. I
have figured out how to use SSIS to pull these into the SQL system as
different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
The state has a habit of changing the fields names from year to year, and
what I would like to do is build standard queries that compares one year to
the next. Since I cannot link this data (it is prenatal birth data) on any
field because there is no like field from one year to the next, what would a
query look like, say, to compare birth_hospital in 2002, 2003, and 2004.
I have three separate Select statements that pulls and groups the data, but
they are feeding into separate panes (one for each year). How do I get them
in one pane side-by-side?
TIA
Any help is appreciated.SELECT birth_date, birth_hospital
FROM Birth2002
UNION
SELECT BirthDate, BirthHospital
FROM Birth2003
UNION
SELECT Bdte, BHosp
FROM Birth2004
"JC HARRIS" wrote:
> I am new to this so hopefully you'll bare with me if this is a stupid
> question.
> I receive data in a dbf format from the state office on a yearly basis. I
> have figured out how to use SSIS to pull these into the SQL system as
> different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
> The state has a habit of changing the fields names from year to year, and
> what I would like to do is build standard queries that compares one year to
> the next. Since I cannot link this data (it is prenatal birth data) on any
> field because there is no like field from one year to the next, what would a
> query look like, say, to compare birth_hospital in 2002, 2003, and 2004.
> I have three separate Select statements that pulls and groups the data, but
> they are feeding into separate panes (one for each year). How do I get them
> in one pane side-by-side?
> TIA
> Any help is appreciated.
>
>