Thursday, March 22, 2012
changing a query
MySQL = "select DateEntered,Shipper,PickupDate,PUTime,City, State, Zip,
Consignee, Destination, DState, DZip, PickupNumber, ShippersNumber,
PONumber, Consignee_Ref_Number, Weight, Number_Packages, Carrier,
Carrier_Number, Trailer_Number, ApptDate, ApptTime, IDFProNumber,
DeliveredDate, DeliveredTime, FreightCharges, TransitTime, Comments,
LastUpdate, lastcomment from IntermodalTracingMasterFile where " &
tmpMyShippers & " Order by [" & strSort & "] desc "
This works fine.
I need to modify it a little I need to have one query that will return when
the DeliveredDate is empty
and anohter query to return the ones that have somethign in the
DeliveredDate field.
Thanks> the DeliveredDate is empty
If by 'empty' you mean NULL, you can add the following to your WHERE clause:
AND DeliveredDate IS NULL
For non-null values:
AND DeliveredDate IS NOT NULL
--
Hope this helps.
Dan Guzman
SQL Server MVP
"johnfli" <john@.here.com> wrote in message
news:us241LQzEHA.2196@.TK2MSFTNGP14.phx.gbl...
> This is my current query that I have in an App I wrote:
> MySQL = "select DateEntered,Shipper,PickupDate,PUTime,City, State, Zip,
> Consignee, Destination, DState, DZip, PickupNumber, ShippersNumber,
> PONumber, Consignee_Ref_Number, Weight, Number_Packages, Carrier,
> Carrier_Number, Trailer_Number, ApptDate, ApptTime, IDFProNumber,
> DeliveredDate, DeliveredTime, FreightCharges, TransitTime, Comments,
> LastUpdate, lastcomment from IntermodalTracingMasterFile where " &
> tmpMyShippers & " Order by [" & strSort & "] desc "
>
> This works fine.
> I need to modify it a little I need to have one query that will return
> when
> the DeliveredDate is empty
> and anohter query to return the ones that have somethign in the
> DeliveredDate field.
>
> Thanks
>
Monday, March 19, 2012
Changed from char to varchar
I tried entering it with the trim command still no good
i looked a the sql command made in vs and it says that the variables are varchar
is there something i am missing with varchar
does it only work properly if it is over 50 or does it not change completely when you change from char to varcharIt shouldn't be padding the fields if using varchar. Your existng values would have to be trimmed. I don't think changing the datatype would automatically do that for you.
Check the ANSI_PADDING database option, also.|||alright i will look into it
Thursday, February 16, 2012
Change property based on actual state of collapsed/expanded group
Hi, please I would like to use something like this>
=IIF(table1_group2 is Collapsed,True,False)
I want to generated some event based on actual state of e.g. report group. if user expand group make this event otherwise (group is collapsed) make another event.
Thanks for your advice.
Any Answers? Please send me the link where it was disccussed or it's impossible to do it?|||I'm also looking for a similar solution. Any luck?Sunday, February 12, 2012
change of value at the time of insertion
Here is a query that i am creating a table
create table test10 (item varchar(10),state bit)
now at the time of insertion i will enter like this
insert into test10 values ('book' ,1)
but at the time of display in the table i want
item state
book true
from above i want to ask that when i am going to insert 1 i want to
get true and 0 as false.I never enter true or false in the insert
command. please help me in coding.
thankyou,
lucky.
Replyis this homework, or a real world question? if real world, come up
with better examples.
thx.|||Hai doug,
This is baba what i have askd is not for fun really i
want to know wether i am going to get 1 as true in the output table it
is a request from my side i am new to the SQL i know u r having valuble
time i dont want to waste it if my query is good please give me the
answer. thankyou,
baba.|||Hi Lucky
A column of type bit can hold the values 0 or 1. Depending on the client
side programming language it may interpret 0 as false and 1 as true. For
example in VB.Net you could bind this to a boolean (logical) field in a
ADO.Net datatable.
Within T-sql you could say:
select item, case when state = 0 then 'false' else 'true' end as state1
from test10
But in this case, from an application's (such as one written in VB.Net)
point of view the 'true' or 'false' returned are character strings not
boolean (logical) values.
--
-Dick Christoph
"lucky" <j.v.s.s.baba@.gmail.com> wrote in message
news:1142488231.981434.27360@.p10g2000cwp.googlegro ups.com...
> Hai,
> Here is a query that i am creating a table
> create table test10 (item varchar(10),state bit)
>
> now at the time of insertion i will enter like this
>
> insert into test10 values ('book' ,1)
>
> but at the time of display in the table i want
>
> item state
> book true
>
> from above i want to ask that when i am going to insert 1 i want to
> get true and 0 as false.I never enter true or false in the insert
> command. please help me in coding.
> thankyou,
> lucky.
>
> Reply
change of value at the time of insertion
Here is a query that i am creating a table
create table test10 (item varchar(10),state bit)
now at the time of insertion i will enter like this
insert into test10 values ('book' ,1)
but at the time of display in the table i want
item state
book true
from above i want to ask that when i am going to insert 1 i want to
get true and 0 as false.I never enter true or false in the insert
command. please help me in coding.
thankyou,
lucky.Hi
create table test10 (item varchar(10),state bit)
insert into test10 values ('book' ,1)
select item,case when state=1 then 'true' else 'false' end as state
from test10
drop table test10
"lucky" <j.v.s.s.baba@.gmail.com> wrote in message
news:1142488029.691844.64920@.j52g2000cwj.googlegroups.com...
> Hai,
> Here is a query that i am creating a table
> create table test10 (item varchar(10),state bit)
> now at the time of insertion i will enter like this
> insert into test10 values ('book' ,1)
>
> but at the time of display in the table i want
> item state
> book true
> from above i want to ask that when i am going to insert 1 i want to
> get true and 0 as false.I never enter true or false in the insert
> command. please help me in coding.
> thankyou,
> lucky.
>