LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sql query

Hello,
 
I built a DB and a VI that using the DB Tools select data.vi and a simple query selects the desired information. The optional clause in the DB Tools Select Data works correctly in all cases except when I need to query a DATE.
 
I would like to make this query : where DATE= #10/27/2003# (for example)
But the problem is that the '#' key does not work.
 
Does anyone know what am I doing wrong? Is there any solution?
 
Thanks,
 
Nuria
Download All
0 Kudos
Message 1 of 8
(3,597 Views)

I forgot to say that I use LV 7.1 and an Access DataBase.

Thank you!

0 Kudos
Message 2 of 8
(3,589 Views)
 
I remember having this problem in the past. I think it might be confused with the date format mm/dd/yyyy against dd/mm/yyyy formats. I ended up doing something like where DATE= #27-Oct-2003# and it seemed to like that better.
 
David

Message Edited by David Crawford on 01-16-2006 06:49 AM

0 Kudos
Message 3 of 8
(3,592 Views)
Hi
 
I had the same problem - I was not able to enter '#' into a stringconstant, because it is a fixed shorcut in LV.
 
So I just made a vi, which casts the date-string to a byte-array. There I appended 0x23 in front and at the end and got the expected result.
 
Just have a look at the attachment.
 
Hope this helps.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 8
(3,584 Views)

I should have said that this was part of a SQL statement for the DB Tool Execute Query.vi. I don't know if this would make a difference with DB Tools Select Data.vi.

David

0 Kudos
Message 5 of 8
(3,580 Views)

Hello becktho,

I modified a little your VI in order to attach it to my VI and it works fine. Thank you very much!

Could you explain me a little more why it's impossible to enter "#" into a string?

What should I do in order to have a string control where I could type "#27/10/2003#"?

Does anyone know this?

Thank you very much!Smiley Wink

 

Nuria

0 Kudos
Message 6 of 8
(3,562 Views)
As I said - this is because Ctrl + # is a fixed shortcut.
 
Just search the online help for "keyboard shortcuts". There are all shortcuts listed. In section "Navigating the LV Environment" you will find this shortcut.
 
So I guess there is no way to change this.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 7 of 8
(3,543 Views)


@leiabcn wrote:

Hello becktho,

I modified a little your VI in order to attach it to my VI and it works fine. Thank you very much!

Could you explain me a little more why it's impossible to enter "#" into a string?

What should I do in order to have a string control where I could type "#27/10/2003#"?

Does anyone know this?

Thank you very much!Smiley Wink


This is a limitation of your Windows locale not of the LabVIEW string control. With keyboards that to not need multi-finger keypresses to enter the # character there is absolutely no problem with this. Windows applications translate accelerators (menu shortcuts) first before interpreting the key combination so you end up with a catch 22 here. Since LabVIEW has a menu shortcut Ctrl-# Windows does not know better as to pass this shortcut to LabVIEW instead of translating the locale keyboard translation.

Also note that LabVIEW itself does not do locale character translation.

Workaround would be to switch the string control to display \ codes and enter \23 in the string. LabVIEW will then use the #. Or you can install additional keyboards in the International Control Panel and switch to the US American temporarily, which has the # key under shift-3.

Rolf Kalbermatter

Message Edited by rolfk on 01-17-2006 04:11 PM

Rolf Kalbermatter
My Blog
Message 8 of 8
(3,524 Views)